43 label firstFullySubmergedPoint,
54 if (firstFullySubmergedPoint == -1)
66 label i = firstFullySubmergedPoint;
67 i < firstFullySubmergedPoint +
f.size();
72 label idx = i %
f.size();
73 label nextIdx = (i + 1) %
f.size();
75 if (pointStatus[idx] > 0)
79 else if (pointStatus[idx] == 0)
87 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
88 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
91 label nextP =
f.nextLabel(idx);
94 (0.0 - pointStatus[idx]) /
95 (pointStatus[nextIdx] - pointStatus[idx]);
104 if (subFacePoints.
size() >= 3)
121 label firstFullySubmergedPoint,
122 DynamicList<point>& subFacePoints,
123 DynamicList<point>& surfacePoints,
130 const face&
f = mesh_.faces()[faceI];
132 if (firstFullySubmergedPoint == -1)
135 subFaceCentre =
Zero;
144 label i = firstFullySubmergedPoint;
145 i < firstFullySubmergedPoint +
f.
size();
150 label idx = i %
f.
size();
151 label nextIdx = (i + 1) %
f.
size();
153 if (pointStatus[idx] > 0)
155 subFacePoints.append(
points[
f[idx]]);
157 else if (pointStatus[idx] == 0)
159 subFacePoints.append(
points[
f[idx]]);
160 surfacePoints.append(
points[
f[idx]]);
165 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
166 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
169 label nextP =
f.nextLabel(idx);
175 surfacePoints.append(
p);
179 if (subFacePoints.size() >= 3)
182 calcSubFaceCentreAndArea(subFacePoints, subFaceCentre, subFaceArea);
196 label firstFullySubmergedPoint,
197 DynamicList<point>& subFacePoints,
198 DynamicList<point>& surfacePoints,
204 if (firstFullySubmergedPoint == -1)
207 subFaceCentre =
Zero;
215 label i = firstFullySubmergedPoint;
216 i < firstFullySubmergedPoint +
f.
size();
221 label idx = i %
f.
size();
222 label nextIdx = (i + 1) %
f.
size();
224 if (pointStatus[idx] > 0)
226 subFacePoints.append(
points[
f[idx]]);
228 else if (pointStatus[idx] == 0)
230 subFacePoints.append(
points[
f[idx]]);
231 surfacePoints.append(
points[
f[idx]]);
236 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
237 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
240 label nextP =
f.nextLabel(idx);
243 (0.0 - pointStatus[idx]) /
244 (pointStatus[nextIdx] - pointStatus[idx]);
249 surfacePoints.append(
p);
253 if (subFacePoints.size() >= 3)
256 calcSubFaceCentreAndArea(subFacePoints, subFaceCentre, subFaceArea);
267 DynamicList<point>& subFacePoints,
272 const label
nPoints = subFacePoints.size();
298 point fCentre = subFacePoints[0];
302 fCentre += subFacePoints[
pi];
312 vector c = subFacePoints[
pi] + nextPoint + fCentre;
314 (nextPoint - subFacePoints[
pi]) ^ (fCentre - subFacePoints[
pi]);
324 if (sumA < ROOTVSMALL)
326 subFaceCentre = fCentre;
331 subFaceCentre = (1.0 / 3.0) * sumAc / sumA;
332 subFaceArea = 0.5 * sumN;
List< scalar > scalarList
List of scalar.
void size(const label n)
Older name for setAddressableSize.
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void append(const T &val)
Append an element at the end of the list.
void calcSubFaceCentreAndArea(DynamicList< point > &subFacePoints, vector &subFaceCentre, vector &subFaceArea)
Calculates centre and normal of the face.
virtual const pointField & points() const
Return raw points.
vectorField pointField
pointField is a vectorField.
Point centre() const
Return centre (centroid)
constexpr scalar pi(M_PI)
void append(const T &val)
Copy append an element to the end of this list.
virtual const faceList & faces() const
Return raw faces.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
cutFace(const fvMesh &mesh)
Construct from fvMesh.
vector point
Point is a vector.
const dimensionedScalar c
Speed of light in a vacuum.
void calcSubFace(const label faceI, const scalarList &pointStatus, label firstFullySubmergedPoint, DynamicList< point > &subFacePoints, DynamicList< point > &surfacePoints, label &faceStatus, vector &subFaceCentre, vector &subFaceArea)
Calculate cut points along edges of face with pointStatus, pointfield and computes geometric informat...
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
static constexpr const zero Zero
Global zero (0)