Go to the documentation of this file.
53 #ifndef primitiveMesh_H
54 #define primitiveMesh_H
86 label nInternalPoints_;
92 mutable label nInternal0Edges_;
95 mutable label nInternal1Edges_;
98 mutable label nInternalEdges_;
101 mutable label nEdges_;
104 label nInternalFaces_;
194 void calcCellShapes()
const;
197 void calcCellCells()
const;
200 void calcPointCells()
const;
203 void calcCells()
const;
206 void calcCellEdges()
const;
209 void calcPointPoints()
const;
214 void calcEdges(
const bool doFaceEdges)
const;
215 void clearOutEdges();
225 static label findFirstCommonElementFromSortedLists
290 const bitSet& internalOrCoupledFaces
309 const bool detailedReport,
318 const bool detailedReport,
337 const bool detailedReport,
338 const scalar minPyrVol,
374 const scalar warnFlatness,
476 virtual bool init(
const bool doInit)
487 inline label
nPoints() const noexcept;
490 inline label
nEdges() const;
493 inline label
nFaces() const noexcept;
496 inline label
nCells() const noexcept;
550 static
void calcCells
618 const
bool report = false,
625 const
bool report = false,
632 const
bool report = false,
639 const
bool report = false,
646 const
bool report = false,
660 const
bool report = false,
669 const
bool report = false,
676 const
bool report = false,
683 const
bool report = false,
690 const
bool report = false,
691 const scalar minPyrVol = -SMALL,
698 const
bool report = false,
705 const
bool report = false,
706 const scalar maxSin = 10,
716 const scalar warnFlatness,
725 const scalar reportDistSqr,
733 const scalar minLenSqr,
740 const
bool report = false,
754 virtual
bool checkMesh(const
bool report = false) const;
779 scalar inflationFraction = 0
799 inline
bool hasEdges() const noexcept;
803 inline
bool hasCells() const noexcept;
920 #include "primitiveMeshI.H"
void printAllocated() const
Print a list of all the currently allocated mesh data.
bool checkFaceFlatness(const pointField &points, const vectorField &faceCentres, const vectorField &faceAreas, const bool report, const scalar warnFlatness, labelHashSet *setPtr) const
Check face warpage.
bool checkFaceSkewness(const pointField &points, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check face skewness.
static const unsigned pointsPerFace_
Estimated number of points per face.
void clearGeom()
Clear geometry.
bool checkFacePyramids(const pointField &points, const vectorField &ctrs, const bool report, const bool detailedReport, const scalar minPyrVol, labelHashSet *setPtr) const
Check face pyramid volume.
bool hasPointPoints() const noexcept
bool checkFaceAreas(const vectorField &faceAreas, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative face areas.
virtual bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face-face connectivity.
label nInternal0Edges() const
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
virtual const pointField & points() const =0
Return mesh points.
bool hasPointFaces() const noexcept
primitiveMesh()
Construct null.
static const unsigned facesPerPoint_
Estimated number of faces per point.
virtual bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
void clearAddressing()
Clear topological data.
const labelListList & cellPoints() const
A class for managing temporary objects.
virtual const faceList & faces() const =0
Return faces.
virtual ~primitiveMesh()
Destructor.
const labelListList & edgeFaces() const
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
const labelListList & pointFaces() const
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
static scalar setSkewThreshold(const scalar)
Set the skewness warning threshold as percentage.
void clearCellGeom()
Clear cell-based geometry only.
const cellList & cells() const
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
bool checkDuplicateFaces(const label, const Map< label > &, label &nBaffleFaces, labelHashSet *) const
Check if all points on face are shared with another face.
bool hasPointCells() const noexcept
bool hasFaceEdges() const noexcept
label nEdges() const
Number of mesh edges.
bool checkFaceAngles(const pointField &points, const vectorField &faceAreas, const bool report, const scalar maxDeg, labelHashSet *setPtr) const
Check face angles.
bool checkCellVolumes(const scalarField &vols, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative cell volumes.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
static const unsigned edgesPerCell_
Estimated number of edges per cell.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & pointEdges() const
bool hasCellVolumes() const noexcept
virtual bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
label nPoints() const noexcept
Number of mesh points.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
static const unsigned facesPerCell_
Estimated number of faces per cell.
bool checkConcaveCells(const vectorField &fAreas, const pointField &fCentres, const bool report, labelHashSet *setPtr) const
Check for concave cells by the planes of faces.
static const unsigned facesPerEdge_
Estimated number of faces per edge.
virtual bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=nullptr) const
Check edge length.
static scalar setClosedThreshold(const scalar)
Set the closedness ratio warning threshold.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
virtual bool checkGeometry(const bool report=false) const
Check mesh geometry (& implicitly topology) for correctness.
label nCells() const noexcept
Number of mesh cells.
static scalar setNonOrthThreshold(const scalar)
Set the non-orthogonality warning threshold in degrees.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
label findCell(const point &location) const
Find cell enclosing this location (-1 if not in mesh)
label nInternalPoints() const noexcept
Points not on boundary.
const labelListList & cellEdges() const
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
const labelListList & faceEdges() const
bool hasCellCentres() const noexcept
bool hasFaceAreas() const noexcept
const labelListList & cellCells() const
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
static const unsigned pointsPerCell_
Estimated number of points per cell.
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
const labelListList & edgeCells() const
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
static scalar aspectThreshold_
Aspect ratio warning threshold.
ClassName("primitiveMesh")
const scalarField & cellVolumes() const
const cellShapeList & cellShapes() const
Return cell shapes.
virtual bool checkPoints(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for unused points.
static scalar closedThreshold_
Static data to control mesh checking.
bool hasCellCells() const noexcept
const vectorField & cellCentres() const
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
static scalar nonOrthThreshold_
Non-orthogonality warning threshold in deg.
static scalar planarCosAngle_
Threshold where faces are considered coplanar.
static scalar setAspectThreshold(const scalar)
Set the aspect ratio warning threshold.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
static scalar skewThreshold_
Skewness warning threshold.
bool checkClosedCells(const vectorField &faceAreas, const scalarField &cellVolumes, const bool report, labelHashSet *setPtr, labelHashSet *aspectSetPtr, const Vector< label > &meshD) const
Check cells for closedness.
bool checkClosedBoundary(const vectorField &areas, const bool report, const bitSet &internalOrCoupledFaces) const
Check boundary for closedness.
label nInternalFaces() const noexcept
Number of internal faces.
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
bool hasCellShapes() const noexcept
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
const vectorField & faceCentres() const
bool hasCellPoints() const noexcept
void calcEdgeVectors() const
Calculate edge vectors.
tmp< scalarField > movePoints(const pointField &p, const pointField &oldP)
Move points, returns volumes swept by faces in motion.
bool hasCells() const noexcept
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
bool pointInCellBB(const point &p, label celli, scalar inflationFraction=0) const
Return true if the point in the cell bounding box.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
label nFaces() const noexcept
Number of mesh faces.
bool checkFaceOrthogonality(const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check for non-orthogonality.
virtual bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=nullptr) const
Check for point-point-nearness,.
Smooth ATC in cells having a point to a set of patches supplied by type.
bool hasPointEdges() const noexcept
bool hasCellEdges() const noexcept
bool hasFaceCentres() const noexcept
static const unsigned edgesPerPoint_
Estimated number of edges per point.
static const unsigned cellsPerPoint_
Estimated number of cells per point.
virtual void updateGeom()
Update all geometric data.
virtual bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=nullptr) const
Check uniqueness of face vertices.
bool hasEdgeCells() const noexcept
virtual bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=nullptr) const
Check cell zip-up.
bool hasEdgeFaces() const noexcept
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
const labelListList & pointPoints() const
bool hasEdges() const noexcept
const vectorField & faceAreas() const
virtual bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face ordering.
Cell-face mesh analysis engine.