46 void Foam::thresholdCellFaces::calculate
49 const scalar lowerThreshold,
50 const scalar upperThreshold,
51 const bool triangulate
93 labelList oldToNewPoints(origPoints.size(), -1);
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];
132 for (
const label pointi :
f)
134 if (oldToNewPoints[pointi] == -1)
136 oldToNewPoints[pointi] =
nPoints++;
151 surfFace =
f.reverseFace();
178 const polyPatch&
p =
bMesh[patchi];
185 isA<emptyPolyPatch>(
p)
192 label facei =
p.start();
199 field[own[facei]] > lowerThreshold
200 &&
field[own[facei]] < upperThreshold
203 const face&
f = origFaces[facei];
204 for (
const label pointi :
f)
206 if (oldToNewPoints[pointi] == -1)
208 oldToNewPoints[pointi] =
nPoints++;
212 label
cellId = own[facei];
248 forAll(oldToNewPoints, pointi)
250 if (oldToNewPoints[pointi] >= 0)
252 surfPoints[oldToNewPoints[pointi]] = origPoints[pointi];
272 const scalar lowerThreshold,
273 const scalar upperThreshold,
274 const bool triangulate
279 if (lowerThreshold > upperThreshold)
282 << lowerThreshold <<
" > " << upperThreshold <<
endl;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label nPoints() const
Number of points supporting patch faces.
void size(const label n)
Older name for setAddressableSize.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void append(const T &val)
Append an element at the end of the list.
virtual const labelList & faceNeighbour() const
Return face neighbour.
List< face > faceList
A List of faces.
thresholdCellFaces(const polyMesh &mesh, const scalarField &field, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold values.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
label nFaces() const noexcept
Number of mesh faces.
surfZoneList & storedZones()
Non-const access to the zones.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
List< face > & storedFaces()
Non-const access to the faces.
void clear()
Clear the list, i.e. set size to zero.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
pointField & storedPoints()
Non-const access to global points.
virtual const labelList & faceOwner() const
Return face owner.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
label nInternalFaces() const noexcept
Number of internal faces.
virtual const faceList & faces() const
Return raw faces.
const List< face > & surfFaces() const
Return const access to the faces.
defineTypeNameAndDebug(combustionModel, 0)
List< surfZone > surfZoneList
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
#define WarningInFunction
Report a warning using Foam::Warning.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
const surfZoneList & surfZones() const
Const access to the surface zones.
label nFaces() const noexcept
Number of faces in the patch.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points) ...