Loading...
Searching...
No Matches
polyMeshGeometry Class Reference

Updateable mesh geometry and checking routines. More...

#include <polyMeshGeometry.H>

Public Member Functions

 ClassName ("polyMeshGeometry")
 polyMeshGeometry (const polyMesh &)
 Construct from mesh.
const polyMeshmesh () const
const vectorFieldfaceAreas () const
const vectorFieldfaceCentres () const
const vectorFieldcellCentres () const
const scalarFieldcellVolumes () const
void correct ()
 Take over properties from mesh.
void correct (const pointField &p, const labelList &changedFaces)
 Recalculate on selected faces. Recalculates cell properties.
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
bool checkEdgeLength (const bool report, const scalar minEdgeLength, const labelList &checkFaces, labelHashSet *pointSetPtr) const

Static Public Member Functions

static labelList affectedCells (const polyMesh &, const labelList &changedFaces)
 Helper function: get affected cells from faces.
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.
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.
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.
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.
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).
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).
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.
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.
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.
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.
static bool checkFaceArea (const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
 Small faces.
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.
static bool checkEdgeLength (const bool report, const scalar minEdgeLength, const polyMesh &mesh, const labelList &checkFaces, labelHashSet *pointSetPtr)
 Small edges. Optionally collects points of small edges.

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 51 of file polyMeshGeometry.H.

Constructor & Destructor Documentation

◆ polyMeshGeometry()

polyMeshGeometry ( const polyMesh & mesh)
explicit

Construct from mesh.

Definition at line 354 of file polyMeshGeometry.C.

References correct(), and mesh().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "polyMeshGeometry" )

◆ mesh()

◆ faceAreas()

◆ faceCentres()

const vectorField & faceCentres ( ) const
inline

◆ cellCentres()

const vectorField & cellCentres ( ) const
inline

◆ cellVolumes()

const scalarField & cellVolumes ( ) const
inline

Definition at line 177 of file polyMeshGeometry.H.

Referenced by pointSmoother::calculate(), checkVolRatio(), and pointSmoother::update().

Here is the caller graph for this function:

◆ correct() [1/2]

void correct ( )

Take over properties from mesh.

Definition at line 364 of file polyMeshGeometry.C.

Referenced by 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 373 of file polyMeshGeometry.C.

References affectedCells(), and p.

Here is the call graph for this function:

◆ affectedCells()

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

Helper function: get affected cells from faces.

Definition at line 209 of file polyMeshGeometry.C.

References affectedCells(), mesh(), and UList< T >::size().

Referenced by affectedCells(), checkCellDeterminant(), checkCellDeterminant(), motionSmootherAlgo::checkMesh(), motionSmootherAlgo::checkMesh(), and correct().

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

◆ 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

◆ 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

◆ 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

◆ 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 1162 of file polyMeshGeometry.C.

References cellCentres(), coupled, Foam::endl(), faceAreas(), faceCentres(), Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), mesh(), Foam::min(), Foam::nl, patches, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryFacePositions(), and WarningInFunction.

Referenced by checkFaceWeights(), motionSmootherAlgo::checkMesh(), and 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 1310 of file polyMeshGeometry.C.

References cellVolumes(), coupled, Foam::endl(), Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), Foam::max(), mesh(), Foam::min(), Foam::nl, patches, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryFaceList(), and WarningInFunction.

Referenced by motionSmootherAlgo::checkMesh(), motionSmootherAlgo::checkMesh(), and checkVolRatio().

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

◆ 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

◆ 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

◆ 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 1863 of file polyMeshGeometry.C.

References Foam::abort(), Foam::endl(), f(), faceAreas(), faceCentres(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), triangle< Point, PointRef >::mag(), mesh(), Foam::nl, p, Foam::reduce(), and WarningInFunction.

Referenced by checkFaceFlatness(), motionSmootherAlgo::checkMesh(), and 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 1956 of file polyMeshGeometry.C.

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

Referenced by checkFaceArea(), motionSmootherAlgo::checkMesh(), and 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 2013 of file polyMeshGeometry.C.

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

Referenced by checkCellDeterminant(), motionSmootherAlgo::checkMesh(), and motionSmootherAlgo::checkMesh().

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

◆ checkEdgeLength() [1/2]

bool checkEdgeLength ( const bool report,
const scalar minEdgeLength,
const polyMesh & mesh,
const labelList & checkFaces,
labelHashSet * pointSetPtr )
static

Small edges. Optionally collects points of small edges.

Definition at line 2105 of file polyMeshGeometry.C.

References Foam::endl(), f(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::magSqr(), Foam::max(), mesh(), Foam::min(), points, Foam::reduce(), Foam::sqr(), and Foam::sqrt().

Referenced by checkEdgeLength(), motionSmootherAlgo::checkMesh(), and 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 2174 of file polyMeshGeometry.C.

References checkFaceDotProduct().

Here is the call graph for this function:

◆ 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 2197 of file polyMeshGeometry.C.

References checkFacePyramids(), and p.

Here is the call graph for this function:

◆ 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 2221 of file polyMeshGeometry.C.

References checkFaceTets(), and p.

Here is the call graph for this function:

◆ checkFaceWeights() [2/2]

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

Definition at line 2272 of file polyMeshGeometry.C.

References checkFaceWeights().

Here is the call graph for this function:

◆ checkVolRatio() [2/2]

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

Definition at line 2296 of file polyMeshGeometry.C.

References checkVolRatio().

Here is the call graph for this function:

◆ checkFaceAngles() [2/2]

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

Definition at line 2318 of file polyMeshGeometry.C.

References checkFaceAngles(), and p.

Here is the call graph for this function:

◆ checkFaceTwist() [2/2]

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

Definition at line 2340 of file polyMeshGeometry.C.

References checkFaceTwist(), and p.

Here is the call graph for this function:

◆ checkTriangleTwist() [2/2]

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

Definition at line 2364 of file polyMeshGeometry.C.

References checkTriangleTwist(), and p.

Here is the call graph for this function:

◆ checkFaceFlatness() [2/2]

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

Definition at line 2387 of file polyMeshGeometry.C.

References checkFaceFlatness(), and p.

Here is the call graph for this function:

◆ checkFaceArea() [2/2]

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

Definition at line 2410 of file polyMeshGeometry.C.

References checkFaceArea().

Here is the call graph for this function:

◆ checkCellDeterminant() [2/2]

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

Definition at line 2430 of file polyMeshGeometry.C.

References affectedCells(), and checkCellDeterminant().

Here is the call graph for this function:

◆ checkEdgeLength() [2/2]

bool checkEdgeLength ( const bool report,
const scalar minEdgeLength,
const labelList & checkFaces,
labelHashSet * pointSetPtr ) const

Definition at line 2452 of file polyMeshGeometry.C.

References checkEdgeLength().

Here is the call graph for this function:

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