Updateable mesh geometry and checking routines. More...
Public Member Functions | |
ClassName ("polyMeshGeometry") | |
polyMeshGeometry (const polyMesh &) | |
Construct from mesh. More... | |
const polyMesh & | mesh () const |
const vectorField & | faceAreas () const |
const vectorField & | faceCentres () const |
const vectorField & | cellCentres () const |
const scalarField & | cellVolumes () 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... | |
Private Member Functions | |
void | updateFaceCentresAndAreas (const pointField &p, const labelList &changedFaces) |
Update face areas and centres on selected faces. More... | |
void | updateCellCentresAndVols (const labelList &changedCells, const labelList &changedFaces) |
Update cell volumes and centres on selected cells. Requires. More... | |
Static Private Member Functions | |
static scalar | checkNonOrtho (const polyMesh &mesh, const bool report, const scalar severeNonorthogonalityThreshold, const label faceI, const vector &s, const vector &d, label &severeNonOrth, label &errorNonOrth, labelHashSet *setPtr) |
Detect&report non-ortho error for single face. More... | |
static scalar | calcSkewness (const point &ownCc, const point &neiCc, const point &fc) |
Calculate skewness given two cell centres and one face centre. More... | |
static bool | checkFaceTet (const polyMesh &, const bool report, const scalar minTetQuality, const pointField &p, const label faceI, const point &fc, const point &cc, labelHashSet *setPtr) |
Detect&report incorrect face-triangle orientation. More... | |
Private Attributes | |
const polyMesh & | mesh_ |
Reference to polyMesh. More... | |
vectorField | faceAreas_ |
Uptodate copy of face areas. More... | |
vectorField | faceCentres_ |
Uptodate copy of face centres. More... | |
vectorField | cellCentres_ |
Uptodate copy of cell centres. More... | |
scalarField | cellVolumes_ |
Uptodate copy of cell volumes. More... | |
Updateable mesh geometry and checking routines.
- non-ortho done across coupled faces.
Definition at line 52 of file polyMeshGeometry.H.
polyMeshGeometry | ( | const polyMesh & | mesh | ) |
Construct from mesh.
Definition at line 336 of file polyMeshGeometry.C.
References polyMeshGeometry::correct().
|
private |
Update face areas and centres on selected faces.
Definition at line 45 of file polyMeshGeometry.C.
References Foam::constant::universal::c, f(), forAll, Foam::mag(), n, nPoints, p, and Foam::constant::mathematical::pi().
|
private |
Update cell volumes and centres on selected cells. Requires.
cells and faces to be consistent set.
Definition at line 101 of file polyMeshGeometry.C.
References cells, boundBox::contains(), forAll, Foam::mag(), boundBox::max(), Foam::max(), mesh, boundBox::min(), Foam::min(), and List::size().
|
staticprivate |
Detect&report non-ortho error for single face.
Definition at line 214 of file polyMeshGeometry.C.
References Foam::acos(), Foam::endl(), HashSet< Key, Hash >::insert(), Foam::mag(), mesh, Foam::Pout, Foam::radToDeg(), s(), and WarningInFunction.
|
staticprivate |
Calculate skewness given two cell centres and one face centre.
|
staticprivate |
Detect&report incorrect face-triangle orientation.
Definition at line 282 of file polyMeshGeometry.C.
References Foam::endl(), f(), forAll, HashSet< Key, Hash >::insert(), mesh, p, and Foam::Pout.
ClassName | ( | "polyMeshGeometry" | ) |
|
inline |
Definition at line 138 of file polyMeshGeometry.H.
References polyMeshGeometry::mesh_.
Referenced by motionSmootherAlgo::checkMesh().
|
inline |
Definition at line 143 of file polyMeshGeometry.H.
References polyMeshGeometry::faceAreas_.
Referenced by motionSmootherAlgo::checkMesh().
|
inline |
Definition at line 147 of file polyMeshGeometry.H.
References polyMeshGeometry::faceCentres_.
Referenced by motionSmootherAlgo::checkMesh().
|
inline |
Definition at line 151 of file polyMeshGeometry.H.
References polyMeshGeometry::cellCentres_.
Referenced by motionSmootherAlgo::checkMesh().
|
inline |
Definition at line 155 of file polyMeshGeometry.H.
References polyMeshGeometry::cellVolumes_.
void correct | ( | ) |
Take over properties from mesh.
Definition at line 347 of file polyMeshGeometry.C.
Referenced by polyMeshGeometry::polyMeshGeometry().
void correct | ( | const pointField & | p, |
const labelList & | changedFaces | ||
) |
Recalculate on selected faces. Recalculates cell properties.
Recalculate on selected faces.
on owner and neighbour of these cells.
Definition at line 358 of file polyMeshGeometry.C.
References p.
|
static |
Helper function: get affected cells from faces.
Definition at line 188 of file polyMeshGeometry.C.
References forAll, HashSet< Key, Hash >::insert(), mesh, List::size(), and HashTable::toc().
|
static |
See primitiveMesh.
Definition at line 371 of file polyMeshGeometry.C.
References Foam::acos(), polyMesh::boundaryMesh(), Foam::cos(), Foam::degToRad(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, Foam::Info, primitiveMesh::isInternalFace(), mesh, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), patches, Foam::radToDeg(), Foam::reduce(), SeriousErrorInFunction, and syncTools::swapBoundaryFacePositions().
Referenced by motionSmootherAlgo::checkMesh().
|
static |
See primitiveMesh.
Definition at line 553 of file polyMeshGeometry.C.
References primitiveMesh::cells(), Foam::endl(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), mesh, p, Foam::Pout, Foam::reduce(), and SeriousErrorInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
See primitiveMesh.
Definition at line 734 of file polyMeshGeometry.C.
References polyMesh::boundaryMesh(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMeshTetDecomposition::findBasePoint(), polyMeshTetDecomposition::findSharedBasePoint(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), mesh, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), p, patches, Foam::reduce(), SeriousErrorInFunction, and syncTools::swapBoundaryFacePositions().
Referenced by motionSmootherAlgo::checkMesh().
|
static |
See primitiveMesh.
Definition at line 963 of file polyMeshGeometry.C.
References primitiveMeshTools::boundaryFaceSkewness(), polyMesh::boundaryMesh(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), primitiveMeshTools::faceSkewness(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::max(), mesh, primitiveMesh::nInternalFaces(), Foam::nl, patches, points, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryCellPositions(), and WarningInFunction.
|
static |
Interpolation weights (0.5 for regular mesh)
Definition at line 1176 of file polyMeshGeometry.C.
References polyMesh::boundaryMesh(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::mag(), mesh, Foam::min(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, patches, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryFacePositions(), and WarningInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
Cell volume ratio of neighbouring cells (1 for regular mesh)
Definition at line 1331 of file polyMeshGeometry.C.
References polyMesh::boundaryMesh(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::mag(), Foam::max(), mesh, Foam::min(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, patches, Foam::Pout, Foam::reduce(), syncTools::swapBoundaryFaceList(), and WarningInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
See primitiveMesh.
Definition at line 1473 of file polyMeshGeometry.C.
References Foam::abort(), Foam::asin(), Foam::degToRad(), Foam::endl(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), Foam::max(), mesh, Foam::min(), p, Foam::radToDeg(), Foam::reduce(), Foam::sin(), and WarningInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
Triangle (from face-centre decomposition) normal v.s.
average face normal
Definition at line 1606 of file polyMeshGeometry.C.
References Foam::abort(), 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::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, triangle::normal(), p, patches, Foam::reduce(), List::size(), syncTools::swapBoundaryFacePositions(), WarningInFunction, and Vector< scalar >::zero.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
Consecutive triangle (from face-centre decomposition) normals.
Definition at line 1791 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, triangle::normal(), p, Foam::reduce(), List::size(), and WarningInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
Area of faces v.s. sum of triangle areas.
Definition at line 1941 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(), List::size(), and WarningInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
Small faces.
Definition at line 2039 of file polyMeshGeometry.C.
References Foam::endl(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), Foam::nl, Foam::reduce(), and WarningInFunction.
Referenced by motionSmootherAlgo::checkMesh().
|
static |
Area of internal faces v.s. boundary faces.
Definition at line 2100 of file polyMeshGeometry.C.
References cells, primitiveMesh::cells(), Foam::det(), Foam::endl(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), mesh, Foam::min(), Foam::nl, Foam::reduce(), WarningInFunction, and Tensor::zero.
Referenced by motionSmootherAlgo::checkMesh().
bool checkFaceDotProduct | ( | const bool | report, |
const scalar | orthWarn, | ||
const labelList & | checkFaces, | ||
const List< labelPair > & | baffles, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2201 of file polyMeshGeometry.C.
References Foam::polyMeshGenChecks::checkFaceDotProduct().
bool checkFacePyramids | ( | const bool | report, |
const scalar | minPyrVol, | ||
const pointField & | p, | ||
const labelList & | checkFaces, | ||
const List< labelPair > & | baffles, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2224 of file polyMeshGeometry.C.
References Foam::polyMeshGenChecks::checkFacePyramids(), and p.
bool checkFaceTets | ( | const bool | report, |
const scalar | minTetQuality, | ||
const pointField & | p, | ||
const labelList & | checkFaces, | ||
const List< labelPair > & | baffles, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2248 of file polyMeshGeometry.C.
References p.
bool checkFaceWeights | ( | const bool | report, |
const scalar | warnWeight, | ||
const labelList & | checkFaces, | ||
const List< labelPair > & | baffles, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2299 of file polyMeshGeometry.C.
bool checkVolRatio | ( | const bool | report, |
const scalar | warnRatio, | ||
const labelList & | checkFaces, | ||
const List< labelPair > & | baffles, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2323 of file polyMeshGeometry.C.
bool checkFaceAngles | ( | const bool | report, |
const scalar | maxDeg, | ||
const pointField & | p, | ||
const labelList & | checkFaces, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2345 of file polyMeshGeometry.C.
References Foam::polyMeshGenChecks::checkFaceAngles(), and p.
bool checkFaceTwist | ( | const bool | report, |
const scalar | minTwist, | ||
const pointField & | p, | ||
const labelList & | checkFaces, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2367 of file polyMeshGeometry.C.
References p.
bool checkTriangleTwist | ( | const bool | report, |
const scalar | minTwist, | ||
const pointField & | p, | ||
const labelList & | checkFaces, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2391 of file polyMeshGeometry.C.
References p.
bool checkFaceFlatness | ( | const bool | report, |
const scalar | minFlatness, | ||
const pointField & | p, | ||
const labelList & | checkFaces, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2414 of file polyMeshGeometry.C.
References Foam::polyMeshGenChecks::checkFaceFlatness(), and p.
bool checkFaceArea | ( | const bool | report, |
const scalar | minArea, | ||
const labelList & | checkFaces, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2437 of file polyMeshGeometry.C.
bool checkCellDeterminant | ( | const bool | report, |
const scalar | warnDet, | ||
const labelList & | checkFaces, | ||
const labelList & | affectedCells, | ||
labelHashSet * | setPtr | ||
) | const |
Definition at line 2457 of file polyMeshGeometry.C.
|
private |
Reference to polyMesh.
Definition at line 55 of file polyMeshGeometry.H.
Referenced by polyMeshGeometry::mesh().
|
private |
Uptodate copy of face areas.
Definition at line 58 of file polyMeshGeometry.H.
Referenced by polyMeshGeometry::faceAreas().
|
private |
Uptodate copy of face centres.
Definition at line 61 of file polyMeshGeometry.H.
Referenced by polyMeshGeometry::faceCentres().
|
private |
Uptodate copy of cell centres.
Definition at line 64 of file polyMeshGeometry.H.
Referenced by polyMeshGeometry::cellCentres().
|
private |
Uptodate copy of cell volumes.
Definition at line 67 of file polyMeshGeometry.H.
Referenced by polyMeshGeometry::cellVolumes().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.