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,
121 DynamicList<point>& subFacePoints,
122 DynamicList<point>& surfacePoints,
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)
158 subFacePoints.append(
points[
f[idx]]);
159 surfacePoints.append(
points[
f[idx]]);
164 (pointStatus[idx] < 0 && pointStatus[nextIdx] > 0)
165 || (pointStatus[idx] > 0 && pointStatus[nextIdx] < 0)
168 label nextP =
f.nextLabel(idx);
173 subFacePoints.append(
p);
174 surfacePoints.append(
p);
178 if (subFacePoints.size() >= 3)
181 calcSubFaceCentreAndArea(subFacePoints, subFaceCentre, subFaceArea);
195 label firstFullySubmergedPoint,
196 DynamicList<point>& subFacePoints,
197 DynamicList<point>& surfacePoints,
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)
229 subFacePoints.append(
points[
f[idx]]);
230 surfacePoints.append(
points[
f[idx]]);
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]);
247 subFacePoints.append(
p);
248 surfacePoints.append(
p);
252 if (subFacePoints.size() >= 3)
255 calcSubFaceCentreAndArea(subFacePoints, subFaceCentre, subFaceArea);
266 DynamicList<point>& subFacePoints,
271 const label
nPoints = subFacePoints.size();
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];
293 fCentre += subFacePoints[
pi];
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;