49 vertexValue[i] = v[labels[i]];
57 bool allPositive =
true;
58 bool allNegative =
true;
62 if (vertexValue[vI] > 0)
94 label nNewFacePoints = 0;
96 for (
label vI = 0; vI < size() - 1; vI++)
98 if (vertexValue[vI] <= 0)
101 newFacePoints[nNewFacePoints] = meshPoints[faceLabels[vI]];
107 (vertexValue[vI] > 0 && vertexValue[vI + 1] < 0)
108 || (vertexValue[vI] < 0 && vertexValue[vI + 1] > 0)
113 meshPoints[faceLabels[vI]]
114 + vertexValue[vI]/(vertexValue[vI + 1] - vertexValue[vI])
115 *(meshPoints[faceLabels[vI]] - meshPoints[faceLabels[vI + 1]]);
117 newFacePoints[nNewFacePoints] = intersection;
123 if (vertexValue[size() - 1] <= 0)
126 newFacePoints[nNewFacePoints] = meshPoints[faceLabels[size() - 1]];
132 (vertexValue[size() - 1] > 0 && vertexValue[0] < 0)
133 || (vertexValue[size() - 1] < 0 && vertexValue[0] > 0)
138 meshPoints[faceLabels[size() - 1]]
139 + vertexValue[size() - 1]/(vertexValue[0] - vertexValue[size() - 1])
140 *(meshPoints[faceLabels[size() - 1]] - meshPoints[faceLabels[0]]);
142 newFacePoints[nNewFacePoints] = intersection;
146 newFacePoints.
setSize(nNewFacePoints);
157 return face(sfl).
mag(newFacePoints)/(
mag(meshPoints) + vSmall);
#define forAll(list, i)
Loop across all elements in list.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
scalar mag(const pointField &) const
Return scalar magnitude.
scalar areaInContact(const pointField &, const scalarField &v) const
Return area in contact, given the displacement in vertices.
void setSize(const label)
Reset size of List.
dimensioned< scalar > mag(const dimensioned< Type > &)