72 scalar minDist = GREAT;
75 for (
const label patchFacei : wallFaces)
82 minFacei =
patch.start() + patchFacei;
96 const label patchFacei,
103 neighbours.
append(patchFacei);
108 for (
const label nbr : faceNeighbours)
117 const face&
f =
patch.localFaces()[patchFacei];
121 label pointi =
f[fp];
125 for (
const label facei : pointNbs)
143 nbs.insert(pointNbs);
147 for (
const label nb : neighbours)
152 <<
"getPointNeighbours : patchFacei:" << patchFacei
153 <<
" verts:" <<
f <<
endl;
158 <<
"point:" <<
f[fp] <<
" pointFaces:" 162 for (
const label facei : neighbours)
165 <<
"fast nbr:" << facei
170 <<
"Problem: fast pointNeighbours routine included " << nb
171 <<
" which is not in proper neighbour list " << nbs.toc()
180 <<
"Problem: fast pointNeighbours routine did not find " 235 Map<label>& nearestFace
241 DynamicList<label> neighbours(maxPatchSize(
patchIDs));
251 const polyPatch&
patch =
pbm[patchi];
252 const auto areaFraction(
patch.areaFraction());
257 if (areaFraction && (areaFraction()[patchFacei] <= 0.5))
263 getPointNeighbours(
patch, patchFacei, neighbours);
265 label celli = faceOwner[
patch.start() + patchFacei];
269 wallDistCorrected[celli] = smallestDist
278 nearestFace.insert(celli, minFacei);
290 Map<label>& nearestFace
302 const polyPatch&
patch =
pbm[patchi];
303 const auto& localFaces =
patch.localFaces();
307 bitSet isWallPoint(meshPoints.size(),
true);
309 const auto areaFraction(
patch.areaFraction());
314 if (!areaFraction || (areaFraction()[patchFacei] <= 0.5))
317 isWallPoint.unset(localFaces[patchFacei]);
323 forAll(meshPoints, patchPointi)
325 const label vertI = meshPoints[patchPointi];
327 if (!isWallPoint[patchPointi])
334 for (
const label celli : neighbours)
336 if (!nearestFace.found(celli))
338 const labelList& wallFaces = pointFaces[patchPointi];
342 wallDistCorrected[celli] = smallestDist
351 nearestFace.insert(celli, minFacei);
labelHashSet getPatchIDs() const
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const polyBoundaryMesh & pbm
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
label sumPatchSize(const labelHashSet &patchIDs) const
Sum of patch sizes (out of supplied subset of patches).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool found(const T &val, label pos=0) const
Same as contains()
scalar smallestDist(const point &p, const polyPatch &patch, const labelUList &wallFaces, label &meshFacei) const
Calculate smallest true distance (and face index)
List< labelList > labelListList
List of labelList.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
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.
Collection of functions used in wall distance calculation.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
A list of faces which address into the list of points.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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.
void getPointNeighbours(const primitivePatch &, const label patchFacei, DynamicList< label > &) const
Get faces sharing point with face on patch.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
void append(const T &val)
Copy append an element to the end of this list.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
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
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
label push_uniq(const T &val)
Append an element if not already in the list.
scalar distance() const noexcept
Return distance to hit.
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.
const polyMesh & mesh() const
Access mesh.