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 " 197 if (patchIDs.found(patchi))
219 if (patchIDs.found(patchi))
235 Map<label>& nearestFace
239 DynamicList<label> neighbours(maxPatchSize(patchIDs));
247 if (patchIDs.found(patchi))
254 getPointNeighbours(
patch, patchFacei, neighbours);
256 label celli = faceOwner[
patch.start() + patchFacei];
260 wallDistCorrected[celli] = smallestDist
269 nearestFace.insert(celli, minFacei);
281 Map<label>& nearestFace
290 if (patchIDs.found(patchi))
297 forAll(meshPoints, meshPointi)
299 const label vertI = meshPoints[meshPointi];
303 for (
const label celli : neighbours)
305 if (!nearestFace.found(celli))
307 const labelList& wallFaces = pointFaces[meshPointi];
311 wallDistCorrected[celli] = smallestDist
320 nearestFace.insert(celli, minFacei);
labelHashSet getPatchIDs() const
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
void size(const label n)
Older name for setAddressableSize.
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.
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.
label appendUniq(const T &val)
Append an element if not already in the list.
scalar smallestDist(const point &p, const polyPatch &patch, const labelUList &wallFaces, label &meshFacei) const
Calculate smallest true distance (and face index)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
#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.
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.
scalar distance() const noexcept
Return distance to hit.
const std::string patch
OpenFOAM patch number as a std::string.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
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.