46void Foam::thresholdCellFaces::calculate
48 const scalarField&
field,
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;
void transfer(List< T > &list)
void append(const T &val)
Append an element at the end of the list.
void clear()
Clear the list, i.e. set size to zero.
surfZoneList & storedZones()
Non-const access to the zones.
const surfZoneList & 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.
const List< face > & surfFaces() const
Return const access to the faces.
List< face > & storedFaces()
Non-const access to the faces.
label nPoints() const
Number of points supporting patch faces.
label nFaces() const noexcept
Number of faces in the patch.
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if 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 noexcept
Number of internal faces.
label nFaces() const noexcept
Number of mesh faces.
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
List< surfZone > surfZoneList
List< face > faceList
A List of faces.
#define forAll(list, i)
Loop across all elements in list.