Go to the documentation of this file.
46 void Foam::thresholdCellFaces::calculate
49 const scalar lowerThreshold,
50 const scalar upperThreshold,
51 const bool triangulate
91 DynamicList<label> surfCells(
surfFaces.size());
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];
181 zone.start() = nFaces;
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];
232 zone.size() =
surfFaces.size() - zone.start();
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;
285 calculate(
field, lowerThreshold, upperThreshold, triangulate);
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const surfZoneList & surfZones() const
Const access to the surface zones.
List< Face > & storedFaces()
Non-const access to the faces.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
thresholdCellFaces(const polyMesh &mesh, const scalarField &field, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
Construct from mesh, field and threshold values.
pointField & storedPoints()
Non-const access to global points.
const List< Face > & surfFaces() const
Return const access to the faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
surfZoneList & storedZones()
Non-const access to the zones.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
virtual const labelList & faceOwner() const
Return face owner.
void transfer(List< T > &list)
virtual const faceList & faces() const
Return raw faces.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
List< face > faceList
A List of faces.
label nInternalFaces() const noexcept
Number of internal faces.
static bool & parRun() noexcept
Test if this a parallel run.
void clear()
Clear the list, i.e. set size to zero.
List< surfZone > surfZoneList
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
label nFaces() const noexcept
Number of mesh faces.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const labelList & faceNeighbour() const
Return face neighbour.