Collection of functions used in wall distance calculation. More...
Public Member Functions | |
ClassName ("cellDistFuncs") | |
cellDistFuncs (const polyMesh &mesh) | |
Construct from mesh. More... | |
const polyMesh & | mesh () const |
Access mesh. More... | |
labelHashSet | getPatchIDs (const wordReList &patchNames) const |
Return the set of patch IDs corresponding to the given names. More... | |
template<class Type > | |
labelHashSet | getPatchIDs () const |
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch') More... | |
scalar | smallestDist (const point &p, const polyPatch &patch, const label nWallFaces, const labelList &wallFaces, label &meshFacei) const |
Calculate smallest true distance (and face index) More... | |
label | getPointNeighbours (const primitivePatch &, const label patchFacei, labelList &) const |
Get faces sharing point with face on patch. More... | |
label | maxPatchSize (const labelHashSet &patchIDs) const |
Size of largest patch (out of supplied subset of patches) More... | |
label | sumPatchSize (const labelHashSet &patchIDs) const |
Sum of patch sizes (out of supplied subset of patches). More... | |
void | correctBoundaryFaceCells (const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const |
Correct all cells connected to boundary (via face). Sets values in. More... | |
void | correctBoundaryPointCells (const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const |
Correct all cells connected to wall (via point). Sets values in. More... | |
template<class Type > | |
Foam::labelHashSet | getPatchIDs () const |
Collection of functions used in wall distance calculation.
Definition at line 61 of file cellDistFuncs.H.
cellDistFuncs | ( | const polyMesh & | mesh | ) |
Construct from mesh.
Definition at line 62 of file cellDistFuncs.C.
References cellDistFuncs::getPatchIDs().
ClassName | ( | "cellDistFuncs" | ) |
|
inline |
Access mesh.
Definition at line 95 of file cellDistFuncs.H.
References cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::correctBoundaryPointCells(), cellDistFuncs::getPatchIDs(), cellDistFuncs::getPointNeighbours(), cellDistFuncs::maxPatchSize(), nWallFaces(), p, patchNames(), cellDistFuncs::smallestDist(), and cellDistFuncs::sumPatchSize().
Referenced by patchWave::correct(), cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::correctBoundaryPointCells(), cellDistFuncs::getPatchIDs(), cellDistFuncs::maxPatchSize(), and cellDistFuncs::sumPatchSize().
Foam::labelHashSet getPatchIDs | ( | const wordReList & | patchNames | ) | const |
Return the set of patch IDs corresponding to the given names.
Definition at line 71 of file cellDistFuncs.C.
References polyMesh::boundaryMesh(), cellDistFuncs::mesh(), polyBoundaryMesh::patchSet(), and cellDistFuncs::smallestDist().
labelHashSet getPatchIDs | ( | ) | const |
Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
Uses isA, not isType
Referenced by cellDistFuncs::cellDistFuncs(), and cellDistFuncs::mesh().
Foam::scalar smallestDist | ( | const point & | p, |
const polyPatch & | patch, | ||
const label | nWallFaces, | ||
const labelList & | wallFaces, | ||
label & | meshFacei | ||
) | const |
Calculate smallest true distance (and face index)
from pt to faces wallFaces. For efficiency reasons we still pass in patch instead of extracting it from mesh_
Definition at line 83 of file cellDistFuncs.C.
References PointHit< Point >::distance(), cellDistFuncs::getPointNeighbours(), Foam::minDist(), nWallFaces(), points, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and polyPatch::start().
Referenced by cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::correctBoundaryPointCells(), cellDistFuncs::getPatchIDs(), and cellDistFuncs::mesh().
Foam::label getPointNeighbours | ( | const primitivePatch & | patch, |
const label | patchFacei, | ||
labelList & | neighbours | ||
) | const |
Get faces sharing point with face on patch.
Definition at line 117 of file cellDistFuncs.C.
References Foam::abort(), Foam::endl(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceFaces(), Foam::FatalError, FatalErrorInFunction, forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), cellDistFuncs::maxPatchSize(), PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), SeriousErrorInFunction, and List< T >::size().
Referenced by cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::mesh(), and cellDistFuncs::smallestDist().
Foam::label maxPatchSize | ( | const labelHashSet & | patchIDs | ) | const |
Size of largest patch (out of supplied subset of patches)
Definition at line 229 of file cellDistFuncs.C.
References polyMesh::boundaryMesh(), forAll, HashTable< T, Key, Hash >::found(), Foam::max(), cellDistFuncs::mesh(), patchi, and cellDistFuncs::sumPatchSize().
Referenced by cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::getPointNeighbours(), and cellDistFuncs::mesh().
Foam::label sumPatchSize | ( | const labelHashSet & | patchIDs | ) | const |
Sum of patch sizes (out of supplied subset of patches).
Used in sizing arrays.
Definition at line 250 of file cellDistFuncs.C.
References polyMesh::boundaryMesh(), cellDistFuncs::correctBoundaryFaceCells(), forAll, HashTable< T, Key, Hash >::found(), cellDistFuncs::mesh(), patchi, and Foam::sum().
Referenced by patchWave::correct(), cellDistFuncs::maxPatchSize(), and cellDistFuncs::mesh().
void correctBoundaryFaceCells | ( | const labelHashSet & | patchIDs, |
scalarField & | wallDistCorrected, | ||
Map< label > & | nearestFace | ||
) | const |
Correct all cells connected to boundary (via face). Sets values in.
wallDistCorrected. Sets nearest wallface in nearestFace.
Definition at line 272 of file cellDistFuncs.C.
References polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), cellDistFuncs::correctBoundaryPointCells(), polyMesh::faceOwner(), forAll, HashTable< T, Key, Hash >::found(), cellDistFuncs::getPointNeighbours(), HashTable< T, Key, Hash >::insert(), cellDistFuncs::maxPatchSize(), cellDistFuncs::mesh(), patchi, cellDistFuncs::smallestDist(), and polyPatch::start().
Referenced by patchWave::correct(), cellDistFuncs::mesh(), and cellDistFuncs::sumPatchSize().
void correctBoundaryPointCells | ( | const labelHashSet & | patchIDs, |
scalarField & | wallDistCorrected, | ||
Map< label > & | nearestFace | ||
) | const |
Correct all cells connected to wall (via point). Sets values in.
wallDistCorrected. Uses/sets nearest wallFace in nearestFace.
Definition at line 328 of file cellDistFuncs.C.
References polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), forAll, HashTable< T, Key, Hash >::found(), HashTable< T, Key, Hash >::insert(), cellDistFuncs::mesh(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), patchi, primitiveMesh::pointCells(), PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), List< T >::size(), and cellDistFuncs::smallestDist().
Referenced by patchWave::correct(), cellDistFuncs::correctBoundaryFaceCells(), and cellDistFuncs::mesh().
Foam::labelHashSet getPatchIDs | ( | ) | const |
Definition at line 34 of file cellDistFuncsTemplates.C.
References polyMesh::boundaryMesh(), forAll, cellDistFuncs::mesh(), patchi, and UPtrList< T >::size().