Go to the documentation of this file.
48 const scalar lowerThreshold,
49 const scalar upperThreshold,
50 const bool triangulate
54 const labelList& nei = mesh_.faceNeighbour();
56 const faceList& origFaces = mesh_.faces();
93 labelList oldToNewPoints(origPoints.size(), -1);
97 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); ++faceI)
102 if (field[own[faceI]] > lowerThreshold)
104 if (field[nei[faceI]] < lowerThreshold)
109 else if (field[nei[faceI]] > lowerThreshold)
115 if (field[own[faceI]] < upperThreshold)
117 if (field[nei[faceI]] > upperThreshold)
122 else if (field[nei[faceI]] < upperThreshold)
130 const face&
f = origFaces[faceI];
134 if (oldToNewPoints[
f[fp]] == -1)
151 surfFace =
f.reverseFace();
166 surfFaces.
append(surfFace);
172 surfZones[0].
size() = surfFaces.size();
181 zone.start() = nFaces;
185 isA<emptyPolyPatch>(
p)
186 || (Pstream::parRun() && isA<processorPolyPatch>(
p))
199 field[own[faceI]] > lowerThreshold
200 && field[own[faceI]] < upperThreshold
203 const face&
f = origFaces[faceI];
206 if (oldToNewPoints[
f[fp]] == -1)
216 label count =
f.triangles(origPoints, surfFaces);
248 forAll(oldToNewPoints, pointI)
250 if (oldToNewPoints[pointI] >= 0)
252 surfPoints[oldToNewPoints[pointI]] = origPoints[pointI];
258 this->storedPoints().transfer(surfPoints);
259 this->storedFaces().transfer(surfFaces);
260 this->storedZones().transfer(surfZones);
262 meshCells_.transfer(surfCells);
272 const scalar lowerThreshold,
273 const scalar upperThreshold,
274 const bool triangulate
280 if (lowerThreshold > upperThreshold)
283 << lowerThreshold <<
" > " << upperThreshold <<
endl;
286 calculate(field, lowerThreshold, upperThreshold, triangulate);
#define forAll(list, i)
Loop across all elements in list.
void calculate(const scalarField &, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
label triangles(const pointField &points, label &triI, faceList &triFaces) const
Split into triangles using existing points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
thresholdCellFaces(const polyMesh &, const scalarField &, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold value.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
A patch is a list of labels that address the faces in the global face list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A surface zone on a MeshedSurface.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
A list of faces which address into the list of points.