53 #ifndef Foam_primitiveMesh_H 54 #define Foam_primitiveMesh_H 87 label nInternalPoints_;
93 mutable label nInternal0Edges_;
96 mutable label nInternal1Edges_;
99 mutable label nInternalEdges_;
102 mutable label nEdges_;
105 label nInternalFaces_;
195 void calcCellShapes()
const;
198 void calcCellCells()
const;
201 void calcPointCells()
const;
204 void calcCells()
const;
207 void calcCellEdges()
const;
210 void calcPointPoints()
const;
215 void calcEdges(
const bool doFaceEdges)
const;
216 void clearOutEdges();
226 static label findFirstCommonElementFromSortedLists
291 const bitSet& internalOrCoupledFaces
310 const bool detailedReport,
319 const bool detailedReport,
338 const bool detailedReport,
339 const scalar minPyrVol,
375 const scalar warnFlatness,
477 virtual bool init(
const bool doInit)
491 inline label
nEdges() const;
551 static
void calcCells
619 const
bool report = false,
626 const
bool report = false,
633 const
bool report = false,
640 const
bool report = false,
647 const
bool report = false,
661 const
bool report = false,
670 const
bool report = false,
677 const
bool report = false,
684 const
bool report = false,
691 const
bool report = false,
692 const scalar minPyrVol = -SMALL,
699 const
bool report = false,
706 const
bool report = false,
707 const scalar maxSin = 10,
717 const scalar warnFlatness,
726 const scalar reportDistSqr,
734 const scalar minLenSqr,
741 const
bool report = false,
755 virtual
bool checkMesh(const
bool report = false) const;
783 scalar inflationFraction = 0
924 #include "primitiveMeshI.H" bool checkFaceAreas(const vectorField &faceAreas, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative face areas.
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
static scalar aspectThreshold_
Aspect ratio warning threshold.
const labelListList & cellEdges() const
ClassName("primitiveMesh")
bool checkFaceAngles(const pointField &points, const vectorField &faceAreas, const bool report, const scalar maxDeg, labelHashSet *setPtr) const
Check face angles.
void clearAddressing()
Clear topological data.
label findCell(const point &location) const
Find cell enclosing this location (-1 if not in mesh)
label nPoints() const noexcept
Number of mesh points.
const labelListList & faceEdges() const
const labelListList & pointEdges() const
Cell-face mesh analysis engine.
const cellShapeList & cellShapes() const
Return cell shapes.
static scalar setClosedThreshold(const scalar)
Set the closedness ratio warning threshold.
void printAllocated() const
Print a list of all the currently allocated mesh data.
virtual bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=nullptr) const
Check for point-point-nearness,.
virtual const pointField & points() const =0
Return mesh points.
primitiveMesh()
Construct null.
Smooth ATC in cells having a point to a set of patches supplied by type.
A bounding box defined in terms of min/max extrema points.
const cellList & cells() const
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
static const unsigned edgesPerPoint_
Estimated number of edges per point.
static const unsigned pointsPerCell_
Estimated number of points per cell.
label nFaces() const noexcept
Number of mesh faces.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
bool hasCellShapes() const noexcept
void movePoints(const pointField &p, const pointField &oldP)
Move points.
static const unsigned facesPerPoint_
Estimated number of faces per point.
static scalar setAspectThreshold(const scalar)
Set the aspect ratio warning threshold.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
bool checkClosedBoundary(const vectorField &areas, const bool report, const bitSet &internalOrCoupledFaces) const
Check boundary for closedness.
static scalar setSkewThreshold(const scalar)
Set the skewness warning threshold as percentage.
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
static const unsigned pointsPerFace_
Estimated number of points per face.
bool checkFaceSkewness(const pointField &points, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check face skewness.
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 hasEdges() const noexcept
const labelListList & edgeCells() const
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
bool checkFacePyramids(const pointField &points, const vectorField &ctrs, const bool report, const bool detailedReport, const scalar minPyrVol, labelHashSet *setPtr) const
Check face pyramid volume.
static const unsigned facesPerCell_
Estimated number of faces per cell.
void clearGeom()
Clear geometry.
bool checkFaceOrthogonality(const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check for non-orthogonality.
bool hasCellEdges() const noexcept
static scalar closedThreshold_
Static data to control mesh checking.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
static const unsigned cellsPerPoint_
Estimated number of cells per point.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
bool hasPointEdges() const noexcept
label nInternalPoints() const noexcept
Points not on boundary.
bool hasFaceCentres() const noexcept
virtual bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
virtual void updateGeom()
Update all geometric data.
virtual bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=nullptr) const
Check edge length.
label nInternalFaces() const noexcept
Number of internal faces.
bool hasCellCentres() const noexcept
bool hasEdgeFaces() const noexcept
bool hasEdgeCells() const noexcept
static scalar setNonOrthThreshold(const scalar)
Set the non-orthogonality warning threshold in degrees.
const vectorField & cellCentres() const
static const unsigned facesPerEdge_
Estimated number of faces per edge.
label nEdges() const
Number of mesh edges.
bool checkCellVolumes(const scalarField &vols, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative cell volumes.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
static scalar planarCosAngle_
Threshold where faces are considered coplanar.
static const unsigned edgesPerCell_
Estimated number of edges per cell.
bool hasCellPoints() const noexcept
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void calcEdgeVectors() const
Calculate edge vectors.
bool hasPointCells() const noexcept
bool hasFaceEdges() const noexcept
bool hasFaceAreas() const noexcept
bool hasCells() const noexcept
virtual bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=nullptr) const
Check uniqueness of face vertices.
bool hasPointFaces() const noexcept
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const vectorField & faceCentres() const
virtual ~primitiveMesh()
Destructor.
virtual bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
bool hasCellVolumes() const noexcept
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bool checkConcaveCells(const vectorField &fAreas, const pointField &fCentres, const bool report, labelHashSet *setPtr) const
Check for concave cells by the planes of faces.
label nCells() const noexcept
Number of mesh cells.
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
const vectorField & faceAreas() const
virtual const faceList & faces() const =0
Return faces.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
void clearCellGeom()
Clear cell-based geometry only.
bool checkDuplicateFaces(const label, const Map< label > &, label &nBaffleFaces, labelHashSet *) const
Check if all points on face are shared with another face.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
const labelListList & pointPoints() const
const labelListList & pointFaces() const
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
virtual bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=nullptr) const
Check cell zip-up.
virtual bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face ordering.
virtual bool checkPoints(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for unused points.
virtual bool checkGeometry(const bool report=false) const
Check mesh geometry (& implicitly topology) for correctness.
bool hasPointPoints() const noexcept
bool checkFaceFlatness(const pointField &points, const vectorField &faceCentres, const vectorField &faceAreas, const bool report, const scalar warnFlatness, labelHashSet *setPtr) const
Check face warpage.
bool hasCellCells() const noexcept
virtual bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face-face connectivity.
static scalar skewThreshold_
Skewness warning threshold.
static scalar nonOrthThreshold_
Non-orthogonality warning threshold in deg.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using no boundary point.
boundBox cellBb(const label celli) const
The bounding box for given cell index.
const labelListList & cellCells() const
const labelListList & edgeFaces() const
const labelListList & cellPoints() const
const scalarField & cellVolumes() const
bool pointInCellBB(const point &p, label celli, scalar inflationFraction=0) const
Return true if the point in the cell bounding box.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...