41 void Foam::thresholdCellFaces::calculate
44 const scalar lowerThreshold,
45 const scalar upperThreshold,
46 const bool triangulate
86 DynamicList<face> surfFaces(0.5 * mesh_.
nFaces());
87 DynamicList<label> surfCells(surfFaces.size());
89 labelList oldToNewPoints(origPoints.size(), -1);
92 polygonTriangulate triEngine;
100 if (field[own[facei]] > lowerThreshold)
102 if (field[nei[facei]] < lowerThreshold)
107 else if (field[nei[facei]] > lowerThreshold)
113 if (field[own[facei]] < upperThreshold)
115 if (field[nei[facei]] > upperThreshold)
120 else if (field[nei[facei]] < upperThreshold)
128 const face&
f = origFaces[facei];
132 if (oldToNewPoints[
f[fp]] == -1)
149 surfFace =
f.reverseFace();
156 triEngine.triangulate
158 UIndirectList<point>(origPoints, surfFace)
160 forAll(triEngine.triPoints(), i)
162 surfFaces.append(triEngine.triPoints(i, surfFace));
168 surfFaces.append(surfFace);
183 zone.start() = nFaces;
187 isA<emptyPolyPatch>(
p)
201 field[own[facei]] > lowerThreshold
202 && field[own[facei]] < upperThreshold
205 const face&
f = origFaces[facei];
208 if (oldToNewPoints[
f[fp]] == -1)
218 triEngine.triangulate
220 UIndirectList<point>(origPoints,
f)
222 forAll(triEngine.triPoints(), i)
224 surfFaces.append(triEngine.triPoints(i,
f));
238 zone.size() = surfFaces.size() - zone.start();
254 forAll(oldToNewPoints, pointi)
256 if (oldToNewPoints[pointi] >= 0)
258 surfPoints[oldToNewPoints[pointi]] = origPoints[pointi];
278 const scalar lowerThreshold,
279 const scalar upperThreshold,
280 const bool triangulate
286 if (lowerThreshold > upperThreshold)
289 << lowerThreshold <<
" > " << upperThreshold <<
endl;
292 calculate(field, lowerThreshold, upperThreshold,
triangulate);
#define forAll(list, i)
Loop across all elements in list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void clear()
Clear the list, i.e. set size to zero.
const List< surfZone > & surfZones() const
Const access to the surface zones.
pointField & storedPoints()
Non-const access to global points.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
surfZoneList & storedZones()
Non-const access to the zones.
List< face > & storedFaces()
Non-const access to the faces.
label nPoints() const
Return number of points supporting patch faces.
static bool & parRun()
Is this a parallel run?
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual const pointField & points() const
Return raw points.
label nInternalFaces() const
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
thresholdCellFaces(const polyMesh &, const scalarField &, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold value.
volScalarField scalarField(fieldObject, mesh)
const polyBoundaryMesh & bMesh
#define WarningInFunction
Report a warning using Foam::Warning.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
vectorField pointField
pointField is a vectorField.
defineTypeNameAndDebug(combustionModel, 0)
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
List< surfZone > surfZoneList