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;
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const surfZoneList & surfZones() const
List< Face > & storedFaces()
virtual label triangulate()
thresholdCellFaces(const polyMesh &mesh, const scalarField &field, const scalar lowerThreshold, const scalar upperThreshold, const bool triangulate=false)
pointField & storedPoints()
const List< Face > & surfFaces() const
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Mesh consisting of general polyhedral cells.
surfZoneList & storedZones()
Generic templated field type.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
virtual const labelList & faceOwner() const
void transfer(List< T > &list)
virtual const faceList & faces() const
unsigned int count(const UList< bool > &bools, const bool val=true)
List< face > faceList
A List of faces.
label nInternalFaces() const noexcept
static bool & parRun() noexcept
List< surfZone > surfZoneList
word name(const expressions::valueTypeCode typeCode)
label nFaces() const noexcept
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
virtual const labelList & faceNeighbour() const