42 label firstFullySubmergedPoint,
53 if (firstFullySubmergedPoint == -1)
65 label i = firstFullySubmergedPoint;
66 i < firstFullySubmergedPoint +
f.
size();
71 label idx = i %
f.
size();
72 label nextIdx = (i + 1) %
f.
size();
74 if (pointStatus[idx] > 0)
78 else if (pointStatus[idx] == 0)
86 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
87 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
90 label nextP =
f.nextLabel(idx);
93 (0.0 - pointStatus[idx]) /
94 (pointStatus[nextIdx] - pointStatus[idx]);
103 if (subFacePoints.
size() >= 3)
120 label firstFullySubmergedPoint,
129 const face&
f = mesh_.faces()[faceI];
131 if (firstFullySubmergedPoint == -1)
134 subFaceCentre =
Zero;
143 label i = firstFullySubmergedPoint;
144 i < firstFullySubmergedPoint +
f.
size();
149 label idx = i %
f.
size();
150 label nextIdx = (i + 1) %
f.
size();
152 if (pointStatus[idx] > 0)
156 else if (pointStatus[idx] == 0)
164 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
165 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
168 label nextP =
f.nextLabel(idx);
178 if (subFacePoints.
size() >= 3)
181 calcSubFaceCentreAndArea(subFacePoints, subFaceCentre, subFaceArea);
195 label firstFullySubmergedPoint,
203 if (firstFullySubmergedPoint == -1)
206 subFaceCentre =
Zero;
214 label i = firstFullySubmergedPoint;
215 i < firstFullySubmergedPoint +
f.
size();
220 label idx = i %
f.
size();
221 label nextIdx = (i + 1) %
f.
size();
223 if (pointStatus[idx] > 0)
227 else if (pointStatus[idx] == 0)
235 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
236 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
239 label nextP =
f.nextLabel(idx);
242 (0.0 - pointStatus[idx]) /
243 (pointStatus[nextIdx] - pointStatus[idx]);
252 if (subFacePoints.
size() >= 3)
255 calcSubFaceCentreAndArea(subFacePoints, subFaceCentre, subFaceArea);
278 (1.0/3.0)*(subFacePoints[0] + subFacePoints[1] + subFacePoints[2]);
280 subFaceArea = 0.5*((subFacePoints[1] - subFacePoints[0]) ^
281 (subFacePoints[2] - subFacePoints[0]));
289 point fCentre = subFacePoints[0];
291 for (label pi = 1; pi <
nPoints; pi++)
293 fCentre += subFacePoints[pi];
299 for (label pi = 0; pi <
nPoints; pi++)
301 const point& nextPoint = subFacePoints[(pi + 1) %
nPoints];
303 vector c = subFacePoints[pi] + nextPoint + fCentre;
305 (nextPoint - subFacePoints[pi]) ^ (fCentre - subFacePoints[pi]);
315 if (sumA < ROOTVSMALL)
317 subFaceCentre = fCentre;
322 subFaceCentre = (1.0 / 3.0) * sumAc / sumA;
323 subFaceArea = 0.5 * sumN;
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
void size(const label n)
Older name for setAddressableSize.
Base class for cutting a face, faceI, of an fvMesh, mesh_, at its intersections.
void calcSubFace(const label faceI, const scalarList &pointStatus, label firstFullySubmergedPoint, DynamicList< point > &subFacePoints, DynamicList< point > &surfacePoints, label &faceStatus, vector &subFaceCentre, vector &subFaceArea)
void calcSubFaceCentreAndArea(DynamicList< point > &subFacePoints, vector &subFaceCentre, vector &subFaceArea)
Calculates centre and normal of the face.
A face is a list of labels corresponding to mesh vertices.
Mesh data needed to do the Finite Volume discretisation.
virtual const faceList & faces() const
Return raw faces.
virtual const pointField & points() const
Return raw points.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)