46 "useCombinedWallPatch",
85 maxSize =
Foam::max(maxSize, patch.size());
136 const auto areaFraction(
patch.areaFraction());
141 if (areaFraction && (areaFraction()[patchFacei] <= 0.5))
147 getPointNeighbours(
patch, patchFacei, neighbours);
149 label celli = faceOwner[
patch.start() + patchFacei];
153 wallDistCorrected[celli] = smallestDist
162 nearestFace.insert(celli,
patch.start()+minFacei);
187 const auto& localFaces =
patch.localFaces();
191 bitSet isWallPoint(meshPoints.size(),
true);
193 const auto areaFraction(
patch.areaFraction());
198 if (areaFraction && (areaFraction()[patchFacei] <= 0.5))
201 isWallPoint.unset(localFaces[patchFacei]);
207 forAll(meshPoints, patchPointi)
209 const label vertI = meshPoints[patchPointi];
211 if (!isWallPoint[patchPointi])
218 for (
const label celli : neighbours)
220 if (!nearestFace.found(celli))
222 const labelList& wallFaces = pointFaces[patchPointi];
226 wallDistCorrected[celli] = smallestDist
235 nearestFace.insert(celli,
patch.start()+minFacei);
247 const bool doPointCells,
289 const auto areaFraction(
patch.areaFraction());
295 if (areaFraction && (areaFraction()[patchFacei] <= 0.5))
301 getPointNeighbours(wallPatch, nWalls, neighbours);
303 const label celli =
faceCells[patchFacei];
306 wallDistCorrected[celli] = smallestDist
315 nearestFace.insert(celli, nWalls+minFacei);
325 const auto& meshPoints = wallPatch.meshPoints();
326 const auto& localFaces = wallPatch.localFaces();
328 bitSet isWallPoint(meshPoints.size(),
true);
334 const auto areaFraction(
patch.areaFraction());
339 if (areaFraction && (areaFraction()[patchFacei] <= 0.5))
342 isWallPoint.unset(localFaces[nWalls]);
349 const auto& pointFaces = wallPatch.pointFaces();
351 for (
const label patchPointi : isWallPoint)
353 const label verti = meshPoints[patchPointi];
357 for (
const label celli : neighbours)
359 if (!nearestFace.found(celli))
361 const labelList& wallFaces = pointFaces[patchPointi];
365 wallDistCorrected[celli] = smallestDist
374 nearestFace.insert(celli, wallPatch.addressing()[minFacei]);
labelList faceLabels(nFaceLabels)
const polyBoundaryMesh & pbm
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool found(const Key &key) const
Same as contains().
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
const Addr & addressing() const noexcept
The addressing used for the list.
void append(const T &val)
Append an element at the end of the list.
A HashTable to objects of type <T> with a label key.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const labelListList & pointFaces() const
Return point-face addressing.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A List with indirect addressing. Like IndirectList but does not store addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool found(const T &val, label pos=0) const
Same as contains().
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bitSet & unset(const bitSet &other)
Unset (subtract) the bits specified in the other bitset, which is a set difference corresponds to the...
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Collection of functions used in wall distance calculation.
label maxPatchSize(const labelHashSet &patchIDs) const
Size of largest patch (out of supplied subset of patches).
label sumPatchSize(const labelHashSet &patchIDs) const
Sum of patch sizes (out of supplied subset of patches).
labelHashSet getPatchIDs() const
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch').
const polyMesh & mesh() const
Access mesh.
void correctBoundaryFaceCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to boundary (via face). Sets values in.
scalar smallestDist(const point &p, const PatchType &patch, const labelUList &wallFaces, label &patchFacei) const
Calculate smallest true distance (and patch face index).
void getPointNeighbours(const PatchType &, const label patchFacei, DynamicList< label > &) const
Get faces sharing point with face on patch.
void correctBoundaryCells(const labelList &patchIDs, const bool doPointCells, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to any of the patches in patchIDs. Sets.
void correctBoundaryPointCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to wall (via point). Sets values in.
static bool useCombinedWallPatch
Use combined-wall-patches wall distance v.s. v2406 per-patch distance. Default is true.
Smooth ATC in cells next to a set of patches supplied by type.
labelHashSet patchSet(const UList< wordRe > &select, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
virtual const labelList & faceOwner() const
Return face owner.
A patch is a list of labels that address the faces in the global face list.
const labelListList & pointCells() const
const vectorField & cellCentres() const
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const std::string patch
OpenFOAM patch number as a std::string.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
UList< label > labelUList
A UList of labels.
wordList patchNames(nPatches)
#define registerOptSwitch(Name, Type, SwitchVar)
#define forAll(list, i)
Loop across all elements in list.