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)
490 inline label
nEdges()
const;
493 inline label
nFaces()
const;
496 inline label
nCells()
const;
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
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 hasPointEdges() const
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.
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.
label nInternalFaces() const
Number of internal faces.
virtual const faceList & faces() const =0
Return faces.
virtual ~primitiveMesh()
Destructor.
const labelListList & edgeFaces() const
label nFaces() const
Number of mesh faces.
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 hasCellVolumes() const
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.
bool hasCellEdges() const
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
virtual bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
static const unsigned facesPerCell_
Estimated number of faces per cell.
bool hasFaceEdges() const
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.
static scalar setNonOrthThreshold(const scalar)
Set the non-orthogonality warning threshold in degrees.
label nCells() const
Number of mesh cells.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
label findCell(const point &location) const
Find cell enclosing this location (-1 if not in mesh)
const labelListList & cellEdges() const
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
bool hasCellCentres() const
const labelListList & faceEdges() const
const labelListList & cellCells() const
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.
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
static scalar aspectThreshold_
Aspect ratio warning threshold.
ClassName("primitiveMesh")
const scalarField & cellVolumes() const
const cellShapeList & cellShapes() const
Return cell shapes.
bool hasFaceAreas() const
virtual bool checkPoints(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for unused points.
bool hasFaceCentres() const
bool hasEdgeCells() const
static scalar closedThreshold_
Static data to control mesh checking.
bool hasPointPoints() const
const vectorField & cellCentres() const
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.
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
const vectorField & faceCentres() const
label nPoints() const
Number of mesh points.
bool hasEdgeFaces() const
void calcEdgeVectors() const
Calculate edge vectors.
bool hasCellShapes() const
const labelListList & pointCells() const
tmp< scalarField > movePoints(const pointField &p, const pointField &oldP)
Move points, returns volumes swept by faces in motion.
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.
bool hasCellCells() const
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
bool checkFaceOrthogonality(const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check for non-orthogonality.
bool hasPointCells() const
virtual bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=nullptr) const
Check for point-point-nearness,.
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.
bool hasPointFaces() const
label nInternalPoints() const
Points not on boundary.
virtual bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=nullptr) const
Check uniqueness of face vertices.
bool hasCellPoints() const
virtual bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=nullptr) const
Check cell zip-up.
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
const labelListList & pointPoints() const
const vectorField & faceAreas() const
virtual bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face ordering.
Cell-face mesh analysis engine.