51 vertexValue[i] = v[labels[i]];
59 bool allPositive =
true;
60 bool allNegative =
true;
64 if (vertexValue[vI] > 0)
96 label nNewFacePoints = 0;
98 for (label vI = 0; vI <
size() - 1; vI++)
100 if (vertexValue[vI] <= 0)
103 newFacePoints[nNewFacePoints] = meshPoints[faceLabels[vI]];
109 (vertexValue[vI] > 0 && vertexValue[vI + 1] < 0)
110 || (vertexValue[vI] < 0 && vertexValue[vI + 1] > 0)
115 meshPoints[faceLabels[vI]]
116 + vertexValue[vI]/(vertexValue[vI + 1] - vertexValue[vI])
117 *(meshPoints[faceLabels[vI]] - meshPoints[faceLabels[vI + 1]]);
125 if (vertexValue[
size() - 1] <= 0)
128 newFacePoints[nNewFacePoints] = meshPoints[faceLabels[
size() - 1]];
134 (vertexValue[
size() - 1] > 0 && vertexValue[0] < 0)
135 || (vertexValue[
size() - 1] < 0 && vertexValue[0] > 0)
140 meshPoints[faceLabels[
size() - 1]]
141 + vertexValue[
size() - 1]/(vertexValue[0] - vertexValue[
size() - 1])
142 *(meshPoints[faceLabels[
size() - 1]] - meshPoints[faceLabels[0]]);
148 newFacePoints.
setSize(nNewFacePoints);
159 return face(sfl).mag(newFacePoints)/(
mag(meshPoints) + VSMALL);
void setSize(const label n)
Alias for resize()
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
The number of elements in the UList.
void size(const label n)
Older name for setAddressableSize.
scalar mag(const UList< point > &p) const
Magnitude of face area.
scalar areaInContact(const UList< point > &meshPoints, const scalarField &v) const
Return area in contact, given the displacement in vertices.
constexpr face() noexcept=default
Default construct.
#define forAll(list, i)
Loop across all elements in list.