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)
116 + vertexValue[vI]/(vertexValue[vI + 1] - vertexValue[vI])
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)
141 + vertexValue[
size() - 1]/(vertexValue[0] - vertexValue[
size() - 1])
148 newFacePoints.
setSize(nNewFacePoints);
159 return face(sfl).mag(newFacePoints)/(
mag(meshPoints) + VSMALL);
void size(const label n)
Older name for setAddressableSize.
scalar areaInContact(const UList< point > &meshPoints, const scalarField &v) const
Return area in contact, given the displacement in vertices.
scalar mag(const UList< point > &p) const
Magnitude of face area.
pointHit intersection(const point &p, const vector &q, const point &ctr, const UList< point > &meshPoints, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
constexpr face() noexcept=default
Default construct.
labelList faceLabels(nFaceLabels)
#define forAll(list, i)
Loop across all elements in list.
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...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label size() const noexcept
The number of elements in the container.