primitiveMeshTools Class Reference

Collection of static functions operating on primitiveMesh (mainly checks). More...

Inheritance diagram for primitiveMeshTools:
[legend]

Static Public Member Functions

static void updateFaceCentresAndAreas (const primitiveMesh &mesh, const UList< label > &faceIDs, const pointField &p, vectorField &fCtrs, vectorField &fAreas)
 Update face centres and areas for the faces in the set faceIDs. More...
 
static void updateCellCentresAndVols (const primitiveMesh &mesh, const vectorField &fCtrs, const vectorField &fAreas, const List< label > &cellIDs, const List< cell > &cells, vectorField &cellCtrs_s, scalarField &cellVols_s)
 Update cell centres and volumes for the cells in the set cellIDs. More...
 
static void makeFaceCentresAndAreas (const UList< face > &faces, const pointField &p, vectorField &fCtrs, vectorField &fAreas)
 Calculate face centres and areas for specified faces. More...
 
static void makeFaceCentresAndAreas (const primitiveMesh &mesh, const pointField &p, vectorField &fCtrs, vectorField &fAreas)
 Calculate face centres and areas for all mesh faces. More...
 
static void makeCellCentresAndVols (const primitiveMesh &mesh, const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols)
 Calculate cell centres and volumes from face properties. More...
 
static tmp< scalarFieldfaceOrthogonality (const primitiveMesh &mesh, const vectorField &fAreas, const vectorField &cellCtrs)
 Generate non-orthogonality field (internal faces only) More...
 
static void facePyramidVolume (const primitiveMesh &mesh, const pointField &points, const vectorField &cellCtrs, scalarField &ownPyrVol, scalarField &neiPyrVol)
 Generate face pyramid volume fields. More...
 
static tmp< scalarFieldfaceSkewness (const primitiveMesh &mesh, const pointField &points, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs)
 Generate skewness field. More...
 
static void cellClosedness (const primitiveMesh &mesh, const Vector< label > &meshD, const vectorField &areas, const scalarField &vols, scalarField &openness, scalarField &aratio)
 Generate cell openness and cell aspect ratio field. More...
 
static tmp< scalarFieldfaceConcavity (const scalar maxSin, const primitiveMesh &mesh, const pointField &p, const vectorField &faceAreas)
 
static tmp< scalarFieldfaceFlatness (const primitiveMesh &mesh, const pointField &p, const vectorField &fCtrs, const vectorField &faceAreas)
 
static tmp< scalarFieldedgeAlignment (const primitiveMesh &mesh, const Vector< label > &directions, const pointField &p)
 
static tmp< scalarFieldcellDeterminant (const primitiveMesh &mesh, const Vector< label > &directions, const vectorField &faceAreas, const bitSet &internalOrCoupledFace)
 Generate cell determinant field. Normalised to 1 for an internal cube. More...
 
static scalar faceSkewness (const UList< face > &faces, const pointField &p, const vectorField &fCtrs, const vectorField &fAreas, const label facei, const point &ownCc, const point &neiCc)
 Skewness of single face. More...
 
static scalar boundaryFaceSkewness (const UList< face > &faces, const pointField &p, const vectorField &fCtrs, const vectorField &fAreas, const label facei, const point &ownCc)
 Skewness of single boundary face. More...
 
static scalar faceSkewness (const primitiveMesh &mesh, const pointField &p, const vectorField &fCtrs, const vectorField &fAreas, const label facei, const point &ownCc, const point &neiCc)
 Skewness of single face. More...
 
static scalar boundaryFaceSkewness (const primitiveMesh &mesh, const pointField &p, const vectorField &fCtrs, const vectorField &fAreas, const label facei, const point &ownCc)
 Skewness of single boundary face. More...
 
static scalar faceOrthogonality (const point &ownCc, const point &neiCc, const vector &s)
 Orthogonality of single face. More...
 

Detailed Description

Collection of static functions operating on primitiveMesh (mainly checks).

Source files

Definition at line 58 of file primitiveMeshTools.H.

Member Function Documentation

◆ updateFaceCentresAndAreas()

void updateFaceCentresAndAreas ( const primitiveMesh mesh,
const UList< label > &  faceIDs,
const pointField p,
vectorField fCtrs,
vectorField fAreas 
)
static

Update face centres and areas for the faces in the set faceIDs.

Definition at line 37 of file primitiveMeshTools.C.

References f(), polyMesh::faces(), Foam::mag(), mesh, n, nPoints, p, UList< T >::size(), and Foam::Zero.

Referenced by solidBodyFvGeometryScheme::movePoints().

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

◆ updateCellCentresAndVols()

void updateCellCentresAndVols ( const primitiveMesh mesh,
const vectorField fCtrs,
const vectorField fAreas,
const List< label > &  cellIDs,
const List< cell > &  cells,
vectorField cellCtrs_s,
scalarField cellVols_s 
)
static

Update cell centres and volumes for the cells in the set cellIDs.

Definition at line 107 of file primitiveMeshTools.C.

References cellIDs, cells, primitiveMesh::cells(), cellVols, polyMesh::faceOwner(), forAll, Foam::mag(), mesh, refPtr< T >::ref(), UList< T >::size(), and Foam::Zero.

Referenced by solidBodyFvGeometryScheme::movePoints(), and cyclicACMIPolyPatch::scalePatchFaceAreas().

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

◆ makeFaceCentresAndAreas() [1/2]

void makeFaceCentresAndAreas ( const UList< face > &  faces,
const pointField p,
vectorField fCtrs,
vectorField fAreas 
)
static

Calculate face centres and areas for specified faces.

Adjusts the lengths of centres and area normals if required.

Parameters
facesThe faces to consider
pSupport points for faces
[out]fCtrsThe face centres
[out]fAreasThe face area normals

Definition at line 203 of file primitiveMeshTools.C.

References f(), forAll, Foam::mag(), n, nPoints, p, List< T >::resize_nocopy(), UList< T >::size(), and Foam::Zero.

Referenced by primitiveMesh::calcFaceCentresAndAreas(), and polyMesh::checkMeshMotion().

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

◆ makeFaceCentresAndAreas() [2/2]

void makeFaceCentresAndAreas ( const primitiveMesh mesh,
const pointField p,
vectorField fCtrs,
vectorField fAreas 
)
static

Calculate face centres and areas for all mesh faces.

Adjusts the lengths of centres and area normals if required.

Parameters
meshThe mesh faces
pSupport points for faces
[out]fCtrsThe face centres
[out]fAreasThe face area normals

Definition at line 271 of file primitiveMeshTools.C.

References polyMesh::faces(), mesh, and p.

Here is the call graph for this function:

◆ makeCellCentresAndVols()

void makeCellCentresAndVols ( const primitiveMesh mesh,
const vectorField fCtrs,
const vectorField fAreas,
vectorField cellCtrs,
scalarField cellVols 
)
static

Calculate cell centres and volumes from face properties.

Definition at line 283 of file primitiveMeshTools.C.

References cellVols, polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, Foam::mag(), mesh, primitiveMesh::nCells(), refPtr< T >::ref(), and Foam::Zero.

Referenced by primitiveMesh::calcCellCentresAndVols(), polyMesh::checkMeshMotion(), and stabilisedFvGeometryScheme::movePoints().

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

◆ faceOrthogonality() [1/2]

Foam::tmp< Foam::scalarField > faceOrthogonality ( const primitiveMesh mesh,
const vectorField fAreas,
const vectorField cellCtrs 
)
static

Generate non-orthogonality field (internal faces only)

Definition at line 500 of file primitiveMeshTools.C.

References polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, mesh, Time::New(), and primitiveMesh::nInternalFaces().

Referenced by primitiveMesh::checkFaceOrthogonality(), and polyMeshTools::faceOrthogonality().

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

◆ facePyramidVolume()

void facePyramidVolume ( const primitiveMesh mesh,
const pointField points,
const vectorField cellCtrs,
scalarField ownPyrVol,
scalarField neiPyrVol 
)
static

Generate face pyramid volume fields.

Definition at line 581 of file primitiveMeshTools.C.

References f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), forAll, primitiveMesh::isInternalFace(), mesh, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), points, and List< T >::setSize().

Referenced by primitiveMesh::checkFacePyramids().

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

◆ faceSkewness() [1/3]

Foam::tmp< Foam::scalarField > faceSkewness ( const primitiveMesh mesh,
const pointField points,
const vectorField fCtrs,
const vectorField fAreas,
const vectorField cellCtrs 
)
static

Generate skewness field.

Definition at line 528 of file primitiveMeshTools.C.

References polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), mesh, Time::New(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), p, and Foam::skew().

Here is the call graph for this function:

◆ cellClosedness()

void cellClosedness ( const primitiveMesh mesh,
const Vector< label > &  meshD,
const vectorField areas,
const scalarField vols,
scalarField openness,
scalarField aratio 
)
static

Generate cell openness and cell aspect ratio field.

Definition at line 620 of file primitiveMeshTools.C.

References Foam::cmptMag(), Foam::cmptSum(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, Foam::mag(), Foam::max(), mesh, Foam::min(), primitiveMesh::nCells(), pTraits< bool >::nComponents, Foam::pow(), List< T >::setSize(), and Foam::Zero.

Referenced by primitiveMesh::checkClosedCells().

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

◆ faceConcavity()

Foam::tmp< Foam::scalarField > faceConcavity ( const scalar  maxSin,
const primitiveMesh mesh,
const pointField p,
const vectorField faceAreas 
)
static

Generate face concavity field. Returns per face the (sin of the) most concave angle between two consecutive edges

Definition at line 714 of file primitiveMeshTools.C.

References f(), faceNormals(), polyMesh::faces(), UList< T >::first(), forAll, UList< T >::last(), Foam::mag(), Foam::max(), mesh, Time::New(), primitiveMesh::nFaces(), and p.

Referenced by primitiveMesh::checkFaceAngles().

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

◆ faceFlatness()

Foam::tmp< Foam::scalarField > faceFlatness ( const primitiveMesh mesh,
const pointField p,
const vectorField fCtrs,
const vectorField faceAreas 
)
static

Generate face flatness field. Compares the individual triangles' normals against the face average normal. Between 0 (fully warped) and 1 (fully flat)

Definition at line 780 of file primitiveMeshTools.C.

References f(), polyMesh::faces(), forAll, Foam::mag(), mesh, n, Time::New(), primitiveMesh::nFaces(), p, and UList< T >::size().

Referenced by primitiveMesh::checkFaceFlatness().

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

◆ edgeAlignment()

static tmp< scalarField > edgeAlignment ( const primitiveMesh mesh,
const Vector< label > &  directions,
const pointField p 
)
static

Generate edge alignment field. Is per face the minimum aligned edge (does not use edge addressing)

◆ cellDeterminant()

Foam::tmp< Foam::scalarField > cellDeterminant ( const primitiveMesh mesh,
const Vector< label > &  directions,
const vectorField faceAreas,
const bitSet internalOrCoupledFace 
)
static

Generate cell determinant field. Normalised to 1 for an internal cube.

Definition at line 828 of file primitiveMeshTools.C.

References primitiveMesh::cells(), Foam::det(), forAll, Foam::mag(), mesh, primitiveMesh::nCells(), pTraits< bool >::nComponents, Time::New(), Foam::sqr(), bitSet::test(), SymmTensor< Cmpt >::xx(), SymmTensor< Cmpt >::yy(), Foam::Zero, and SymmTensor< Cmpt >::zz().

Here is the call graph for this function:

◆ faceSkewness() [2/3]

Foam::scalar faceSkewness ( const UList< face > &  faces,
const pointField p,
const vectorField fCtrs,
const vectorField fAreas,
const label  facei,
const point ownCc,
const point neiCc 
)
static

Skewness of single face.

Parameters
facesThe faces to consider
pSupport points for faces

Definition at line 379 of file primitiveMeshTools.C.

References f(), forAll, Foam::mag(), Foam::max(), and p.

Here is the call graph for this function:

◆ boundaryFaceSkewness() [1/2]

Foam::scalar boundaryFaceSkewness ( const UList< face > &  faces,
const pointField p,
const vectorField fCtrs,
const vectorField fAreas,
const label  facei,
const point ownCc 
)
static

Skewness of single boundary face.

Parameters
facesThe faces to consider
pSupport points for faces

Definition at line 416 of file primitiveMeshTools.C.

References f(), forAll, Foam::mag(), Foam::max(), Foam::normalised(), and p.

Referenced by polyMeshGeometry::checkFaceSkewness(), and polyMeshTools::faceSkewness().

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

◆ faceSkewness() [3/3]

Foam::scalar faceSkewness ( const primitiveMesh mesh,
const pointField p,
const vectorField fCtrs,
const vectorField fAreas,
const label  facei,
const point ownCc,
const point neiCc 
)
static

Skewness of single face.

Parameters
meshThe mesh faces
pSupport points for faces

Definition at line 454 of file primitiveMeshTools.C.

References polyMesh::faces(), mesh, and p.

Here is the call graph for this function:

◆ boundaryFaceSkewness() [2/2]

Foam::scalar boundaryFaceSkewness ( const primitiveMesh mesh,
const pointField p,
const vectorField fCtrs,
const vectorField fAreas,
const label  facei,
const point ownCc 
)
static

Skewness of single boundary face.

Parameters
meshThe mesh faces
pSupport points for faces

Definition at line 470 of file primitiveMeshTools.C.

References polyMesh::faces(), mesh, and p.

Here is the call graph for this function:

◆ faceOrthogonality() [2/2]

Foam::scalar faceOrthogonality ( const point ownCc,
const point neiCc,
const vector s 
)
static

Orthogonality of single face.

Definition at line 485 of file primitiveMeshTools.C.

References Foam::mag(), and s().

Here is the call graph for this function:

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