polyMeshGeometry Class Reference

Updateable mesh geometry and checking routines. More...

Public Member Functions

 ClassName ("polyMeshGeometry")
 
 polyMeshGeometry (const polyMesh &)
 Construct from mesh. More...
 
const polyMeshmesh () const
 
const vectorFieldfaceAreas () const
 
const vectorFieldfaceCentres () const
 
const vectorFieldcellCentres () const
 
const scalarFieldcellVolumes () const
 
void correct ()
 Take over properties from mesh. More...
 
void correct (const pointField &p, const labelList &changedFaces)
 Recalculate on selected faces. Recalculates cell properties. More...
 
bool checkFaceDotProduct (const bool report, const scalar orthWarn, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr) const
 
bool checkFacePyramids (const bool report, const scalar minPyrVol, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr) const
 
bool checkFaceTets (const bool report, const scalar minTetQuality, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr) const
 
bool checkFaceWeights (const bool report, const scalar warnWeight, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr) const
 
bool checkVolRatio (const bool report, const scalar warnRatio, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr) const
 
bool checkFaceAngles (const bool report, const scalar maxDeg, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr) const
 
bool checkFaceTwist (const bool report, const scalar minTwist, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr) const
 
bool checkTriangleTwist (const bool report, const scalar minTwist, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr) const
 
bool checkFaceFlatness (const bool report, const scalar minFlatness, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr) const
 
bool checkFaceArea (const bool report, const scalar minArea, const labelList &checkFaces, labelHashSet *setPtr) const
 
bool checkCellDeterminant (const bool report, const scalar warnDet, const labelList &checkFaces, const labelList &affectedCells, labelHashSet *setPtr) const
 

Static Public Member Functions

static labelList affectedCells (const polyMesh &, const labelList &changedFaces)
 Helper function: get affected cells from faces. More...
 
static bool checkFaceDotProduct (const bool report, const scalar orthWarn, const polyMesh &, const vectorField &cellCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
 See primitiveMesh. More...
 
static bool checkFacePyramids (const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
 See primitiveMesh. More...
 
static bool checkFaceTets (const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
 See primitiveMesh. More...
 
static bool checkFaceSkewness (const bool report, const scalar internalSkew, const scalar boundarySkew, const polyMesh &mesh, const pointField &points, const vectorField &cellCentres, const vectorField &faceCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
 See primitiveMesh. More...
 
static bool checkFaceWeights (const bool report, const scalar warnWeight, const polyMesh &mesh, const vectorField &cellCentres, const vectorField &faceCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
 Interpolation weights (0.5 for regular mesh) More...
 
static bool checkVolRatio (const bool report, const scalar warnRatio, const polyMesh &mesh, const scalarField &cellVolumes, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
 Cell volume ratio of neighbouring cells (1 for regular mesh) More...
 
static bool checkFaceAngles (const bool report, const scalar maxDeg, const polyMesh &mesh, const vectorField &faceAreas, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
 See primitiveMesh. More...
 
static bool checkFaceTwist (const bool report, const scalar minTwist, const polyMesh &, const vectorField &cellCentres, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
 Triangle (from face-centre decomposition) normal v.s. More...
 
static bool checkTriangleTwist (const bool report, const scalar minTwist, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
 Consecutive triangle (from face-centre decomposition) normals. More...
 
static bool checkFaceFlatness (const bool report, const scalar minFlatness, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
 Area of faces v.s. sum of triangle areas. More...
 
static bool checkFaceArea (const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
 Small faces. More...
 
static bool checkCellDeterminant (const bool report, const scalar minDet, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, const labelList &affectedCells, labelHashSet *setPtr)
 Area of internal faces v.s. boundary faces. More...
 

Detailed Description

Updateable mesh geometry and checking routines.

  • non-ortho done across coupled faces.
  • faceWeight (delta factors) done across coupled faces.
Source files

Definition at line 55 of file polyMeshGeometry.H.

Constructor & Destructor Documentation

◆ polyMeshGeometry()

polyMeshGeometry ( const polyMesh mesh)
explicit

Construct from mesh.

Definition at line 335 of file polyMeshGeometry.C.

References polyMeshGeometry::correct().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "polyMeshGeometry"  )

◆ mesh()

const polyMesh & mesh ( ) const
inline

Definition at line 141 of file polyMeshGeometry.H.

Referenced by motionSmootherAlgo::checkMesh().

Here is the caller graph for this function:

◆ faceAreas()

const vectorField & faceAreas ( ) const
inline

Definition at line 146 of file polyMeshGeometry.H.

Referenced by motionSmootherAlgo::checkMesh().

Here is the caller graph for this function:

◆ faceCentres()

const vectorField & faceCentres ( ) const
inline

Definition at line 150 of file polyMeshGeometry.H.

Referenced by motionSmootherAlgo::checkMesh(), and triSurfaceMesh::coordinates().

Here is the caller graph for this function:

◆ cellCentres()

const vectorField & cellCentres ( ) const
inline

Definition at line 154 of file polyMeshGeometry.H.

Referenced by motionSmootherAlgo::checkMesh().

Here is the caller graph for this function:

◆ cellVolumes()

const scalarField & cellVolumes ( ) const
inline

Definition at line 158 of file polyMeshGeometry.H.

◆ correct() [1/2]

void correct ( )

Take over properties from mesh.

Definition at line 345 of file polyMeshGeometry.C.

Referenced by polyMeshGeometry::polyMeshGeometry().

Here is the caller graph for this function:

◆ correct() [2/2]

void correct ( const pointField p,
const labelList changedFaces 
)

Recalculate on selected faces. Recalculates cell properties.

on owner and neighbour of these cells.

Definition at line 354 of file polyMeshGeometry.C.

References p.

◆ affectedCells()

Foam::labelList affectedCells ( const polyMesh mesh,
const labelList changedFaces 
)
static

Helper function: get affected cells from faces.

Definition at line 190 of file polyMeshGeometry.C.

References polyMesh::faceNeighbour(), polyMesh::faceOwner(), HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), mesh, UList< T >::size(), and HashTable< T, Key, Hash >::toc().

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceDotProduct() [1/2]

bool checkFaceDotProduct ( const bool  report,
const scalar  orthWarn,
const polyMesh mesh,
const vectorField cellCentres,
const vectorField faceAreas,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
)
static

See primitiveMesh.

Definition at line 367 of file polyMeshGeometry.C.

References Foam::acos(), polyMesh::boundaryMesh(), Foam::cos(), coupled(), Foam::degToRad(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::Info, primitiveMesh::isInternalFace(), mesh, primitiveMesh::nBoundaryFaces(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), patches, Foam::radToDeg(), Foam::reduce(), SeriousErrorInFunction, syncTools::swapBoundaryFacePositions(), and polyBoundaryMesh::whichPatch().

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFacePyramids() [1/2]

bool checkFacePyramids ( const bool  report,
const scalar  minPyrVol,
const polyMesh mesh,
const vectorField cellCentres,
const pointField p,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
)
static

See primitiveMesh.

Definition at line 545 of file polyMeshGeometry.C.

References primitiveMesh::cells(), Foam::endl(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), mesh, p, Foam::Pout, Foam::reduce(), and SeriousErrorInFunction.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceTets() [1/2]

bool checkFaceTets ( const bool  report,
const scalar  minPyrVol,
const polyMesh mesh,
const vectorField cellCentres,
const vectorField faceCentres,
const pointField p,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
)
static

See primitiveMesh.

Definition at line 716 of file polyMeshGeometry.C.

References polyMesh::boundaryMesh(), coupled(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMeshTetDecomposition::findBasePoint(), polyMeshTetDecomposition::findSharedBasePoint(), Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), mesh, primitiveMesh::nBoundaryFaces(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), p, patches, Foam::reduce(), SeriousErrorInFunction, syncTools::swapBoundaryFacePositions(), and polyBoundaryMesh::whichPatch().

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceSkewness()

bool checkFaceSkewness ( const bool  report,
const scalar  internalSkew,
const scalar  boundarySkew,
const polyMesh mesh,
const pointField points,
const vectorField cellCentres,
const vectorField faceCentres,
const vectorField faceAreas,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
)
static

See primitiveMesh.

Definition at line 937 of file polyMeshGeometry.C.

References primitiveMeshTools::boundaryFaceSkewness(), polyMesh::boundaryMesh(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), cellQuality::faceSkewness(), Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::max(), mesh, primitiveMesh::nInternalFaces(), Foam::nl, patches, points, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryCellPositions(), WarningInFunction, and polyBoundaryMesh::whichPatch().

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceWeights() [1/2]

bool checkFaceWeights ( const bool  report,
const scalar  warnWeight,
const polyMesh mesh,
const vectorField cellCentres,
const vectorField faceCentres,
const vectorField faceAreas,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
)
static

Interpolation weights (0.5 for regular mesh)

Definition at line 1143 of file polyMeshGeometry.C.

References polyMesh::boundaryMesh(), coupled(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::mag(), mesh, Foam::min(), primitiveMesh::nBoundaryFaces(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, patches, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryFacePositions(), WarningInFunction, and polyBoundaryMesh::whichPatch().

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkVolRatio() [1/2]

bool checkVolRatio ( const bool  report,
const scalar  warnRatio,
const polyMesh mesh,
const scalarField cellVolumes,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
)
static

Cell volume ratio of neighbouring cells (1 for regular mesh)

Definition at line 1291 of file polyMeshGeometry.C.

References polyMesh::boundaryMesh(), coupled(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::mag(), Foam::max(), mesh, Foam::min(), primitiveMesh::nBoundaryFaces(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, patches, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryFaceList(), WarningInFunction, and polyBoundaryMesh::whichPatch().

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceAngles() [1/2]

bool checkFaceAngles ( const bool  report,
const scalar  maxDeg,
const polyMesh mesh,
const vectorField faceAreas,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
)
static

See primitiveMesh.

Definition at line 1427 of file polyMeshGeometry.C.

References Foam::abort(), Foam::asin(), Foam::degToRad(), Foam::endl(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, UList< T >::first(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), UList< T >::last(), Foam::mag(), Foam::max(), mesh, Foam::min(), Foam::normalised(), p, Foam::radToDeg(), Foam::reduce(), Foam::sin(), and WarningInFunction.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceTwist() [1/2]

bool checkFaceTwist ( const bool  report,
const scalar  minTwist,
const polyMesh mesh,
const vectorField cellCentres,
const vectorField faceAreas,
const vectorField faceCentres,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
)
static

Triangle (from face-centre decomposition) normal v.s.

average face normal

Definition at line 1552 of file polyMeshGeometry.C.

References Foam::abort(), triangle< Point, PointRef >::areaNormal(), polyMesh::boundaryMesh(), Foam::endl(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::mag(), mesh, primitiveMesh::nBoundaryFaces(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, Foam::normalised(), p, patches, Foam::reduce(), UList< T >::size(), syncTools::swapBoundaryFacePositions(), WarningInFunction, polyBoundaryMesh::whichPatch(), and Foam::Zero.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkTriangleTwist() [1/2]

bool checkTriangleTwist ( const bool  report,
const scalar  minTwist,
const polyMesh mesh,
const vectorField faceAreas,
const vectorField faceCentres,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
)
static

Consecutive triangle (from face-centre decomposition) normals.

Definition at line 1698 of file polyMeshGeometry.C.

References Foam::abort(), triangle< Point, PointRef >::areaNormal(), Foam::endl(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, UList< T >::fcIndex(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), mesh, Foam::nl, p, Foam::reduce(), UList< T >::size(), and WarningInFunction.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceFlatness() [1/2]

bool checkFaceFlatness ( const bool  report,
const scalar  minFlatness,
const polyMesh mesh,
const vectorField faceAreas,
const vectorField faceCentres,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
)
static

Area of faces v.s. sum of triangle areas.

Definition at line 1844 of file polyMeshGeometry.C.

References Foam::abort(), Foam::endl(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), mesh, Foam::nl, p, Foam::reduce(), UList< T >::size(), and WarningInFunction.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceArea() [1/2]

bool checkFaceArea ( const bool  report,
const scalar  minArea,
const polyMesh mesh,
const vectorField faceAreas,
const labelList checkFaces,
labelHashSet setPtr 
)
static

Small faces.

Definition at line 1937 of file polyMeshGeometry.C.

References Foam::endl(), Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), Foam::nl, Foam::reduce(), and WarningInFunction.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkCellDeterminant() [1/2]

bool checkCellDeterminant ( const bool  report,
const scalar  minDet,
const polyMesh mesh,
const vectorField faceAreas,
const labelList checkFaces,
const labelList affectedCells,
labelHashSet setPtr 
)
static

Area of internal faces v.s. boundary faces.

Definition at line 1994 of file polyMeshGeometry.C.

References cells, primitiveMesh::cells(), Foam::det(), Foam::endl(), Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), mesh, Foam::min(), Foam::nl, Foam::reduce(), WarningInFunction, and Foam::Zero.

Referenced by motionSmootherAlgo::checkMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkFaceDotProduct() [2/2]

bool checkFaceDotProduct ( const bool  report,
const scalar  orthWarn,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
) const

Definition at line 2086 of file polyMeshGeometry.C.

◆ checkFacePyramids() [2/2]

bool checkFacePyramids ( const bool  report,
const scalar  minPyrVol,
const pointField p,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
) const

Definition at line 2109 of file polyMeshGeometry.C.

References p.

◆ checkFaceTets() [2/2]

bool checkFaceTets ( const bool  report,
const scalar  minTetQuality,
const pointField p,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
) const

Definition at line 2133 of file polyMeshGeometry.C.

References p.

◆ checkFaceWeights() [2/2]

bool checkFaceWeights ( const bool  report,
const scalar  warnWeight,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
) const

Definition at line 2184 of file polyMeshGeometry.C.

◆ checkVolRatio() [2/2]

bool checkVolRatio ( const bool  report,
const scalar  warnRatio,
const labelList checkFaces,
const List< labelPair > &  baffles,
labelHashSet setPtr 
) const

Definition at line 2208 of file polyMeshGeometry.C.

◆ checkFaceAngles() [2/2]

bool checkFaceAngles ( const bool  report,
const scalar  maxDeg,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
) const

Definition at line 2230 of file polyMeshGeometry.C.

References p.

◆ checkFaceTwist() [2/2]

bool checkFaceTwist ( const bool  report,
const scalar  minTwist,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
) const

Definition at line 2252 of file polyMeshGeometry.C.

References p.

◆ checkTriangleTwist() [2/2]

bool checkTriangleTwist ( const bool  report,
const scalar  minTwist,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
) const

Definition at line 2276 of file polyMeshGeometry.C.

References p.

◆ checkFaceFlatness() [2/2]

bool checkFaceFlatness ( const bool  report,
const scalar  minFlatness,
const pointField p,
const labelList checkFaces,
labelHashSet setPtr 
) const

Definition at line 2299 of file polyMeshGeometry.C.

References p.

◆ checkFaceArea() [2/2]

bool checkFaceArea ( const bool  report,
const scalar  minArea,
const labelList checkFaces,
labelHashSet setPtr 
) const

Definition at line 2322 of file polyMeshGeometry.C.

◆ checkCellDeterminant() [2/2]

bool checkCellDeterminant ( const bool  report,
const scalar  warnDet,
const labelList checkFaces,
const labelList affectedCells,
labelHashSet setPtr 
) const

Definition at line 2342 of file polyMeshGeometry.C.


The documentation for this class was generated from the following files: