46 "useCombinedWallPatch",
119 Map<label>& nearestFace
125 DynamicList<label> neighbours(maxPatchSize(
patchIDs));
135 const polyPatch&
patch =
pbm[patchi];
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);
174 Map<label>& nearestFace
186 const polyPatch&
patch =
pbm[patchi];
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,
249 Map<label>& nearestFace
283 DynamicList<label> neighbours;
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]);
labelHashSet getPatchIDs() const
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const polyBoundaryMesh & pbm
label sumPatchSize(const labelHashSet &patchIDs) const
Sum of patch sizes (out of supplied subset of patches).
void append(const T &val)
Append an element at the end of the list.
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.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
bool found(const T &val, label pos=0) const
Same as contains()
labelList faceLabels(nFaceLabels)
List< labelList > labelListList
List of labelList.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
UList< label > labelUList
A UList of labels.
void correctBoundaryFaceCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to boundary (via face). Sets values in.
#define forAll(list, i)
Loop across all elements in list.
static bool useCombinedWallPatch
Use combined-wall-patches wall distance v.s. v2406 per-patch distance. Default is true...
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
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.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label size() const noexcept
The number of entries in the list.
wordList patchNames(nPatches)
virtual const labelList & faceOwner() const
Return face owner.
void correctBoundaryPointCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to wall (via point). Sets values in.
const vectorField & cellCentres() const
label maxPatchSize(const labelHashSet &patchIDs) const
Size of largest patch (out of supplied subset of patches)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const labelListList & pointCells() const
defineTypeNameAndDebug(combustionModel, 0)
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
const std::string patch
OpenFOAM patch number as a std::string.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
A patch is a list of labels that address the faces in the global face list.
registerOptSwitch("useCombinedWallPatch", bool, Foam::cellDistFuncs::useCombinedWallPatch)
const polyMesh & mesh() const
Access mesh.