Go to the documentation of this file.
44 Foam::label Foam::cellDistFuncs::findIndex
51 for (label i = 0; i < nElems; i++)
95 scalar minDist = GREAT;
98 for (label wallFacei = 0; wallFacei <
nWallFaces; wallFacei++)
100 label patchFacei = wallFaces[wallFacei];
107 minFacei =
patch.start() + patchFacei;
121 const label patchFacei,
125 label nNeighbours = 0;
128 neighbours[nNeighbours++] = patchFacei;
133 forAll(faceNeighbours, faceNeighbourI)
135 neighbours[nNeighbours++] = faceNeighbours[faceNeighbourI];
139 label nEdgeNbs = nNeighbours;
146 const face&
f =
patch.localFaces()[patchFacei];
150 label pointi =
f[fp];
156 label facei = pointNbs[nbI];
159 if (
findIndex(nEdgeNbs, neighbours, facei) == -1)
161 neighbours[nNeighbours++] = facei;
177 nbs.insert(pointNbs);
181 for (label i = 0; i < nNeighbours; i++)
183 label nb = neighbours[i];
188 <<
"getPointNeighbours : patchFacei:" << patchFacei
189 <<
" verts:" <<
f <<
endl;
194 <<
"point:" <<
f[fp] <<
" pointFaces:"
198 for (label i = 0; i < nNeighbours; i++)
201 <<
"fast nbr:" << neighbours[i]
206 <<
"Problem: fast pointNeighbours routine included " << nb
207 <<
" which is not in proper neighbour list " << nbs.toc()
216 <<
"Problem: fast pointNeighbours routine did not find "
235 if (patchIDs.
found(patchi))
257 if (patchIDs.
found(patchi))
277 label maxPointNeighbours = maxPatchSize(patchIDs);
279 labelList neighbours(maxPointNeighbours);
288 if (patchIDs.
found(patchi))
295 label nNeighbours = getPointNeighbours
302 label celli = faceOwner[
patch.start() + patchFacei];
306 wallDistCorrected[celli] = smallestDist
316 nearestFace.insert(celli, minFacei);
338 if (patchIDs.
found(patchi))
345 forAll(meshPoints, meshPointi)
347 label vertI = meshPoints[meshPointi];
351 forAll(neighbours, neighbourI)
353 label celli = neighbours[neighbourI];
355 if (!nearestFace.found(celli))
357 const labelList& wallFaces = pointFaces[meshPointi];
361 wallDistCorrected[celli] = smallestDist
371 nearestFace.insert(celli, minFacei);
int debug
Static debugging option.
List< label > labelList
A List of labels.
label maxPatchSize(const labelHashSet &patchIDs) const
Size of largest patch (out of supplied subset of patches)
scalar smallestDist(const point &p, const polyPatch &patch, const label nWallFaces, const labelList &wallFaces, label &meshFacei) const
Calculate smallest true distance (and face index)
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
void correctBoundaryPointCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to wall (via point). Sets values in.
scalar distance() const
Return distance to hit.
labelHashSet getPatchIDs() const
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
A patch is a list of labels that address the faces in the global face list.
label findIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
Deprecated(2017-10) search for first occurrence of the given element.
virtual const labelList & faceOwner() const
Return face owner.
label sumPatchSize(const labelHashSet &patchIDs) const
Sum of patch sizes (out of supplied subset of patches).
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
wordList patchNames(nPatches)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
label getPointNeighbours(const primitivePatch &, const label patchFacei, labelList &) const
Get faces sharing point with face on patch.
errorManip< error > abort(error &err)
const vectorField & cellCentres() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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.
const labelListList & pointCells() const
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A face is a list of labels corresponding to mesh vertices.
void correctBoundaryFaceCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to boundary (via face). Sets values in.
bool found(const Key &key) const
Return true if hashed entry is found in table.
defineTypeNameAndDebug(combustionModel, 0)
A list of faces which address into the list of points.