50 #ifndef primitiveMesh_H
51 #define primitiveMesh_H
82 label nInternalPoints_;
88 mutable label nInternal0Edges_;
91 mutable label nInternal1Edges_;
94 mutable label nInternalEdges_;
97 mutable label nEdges_;
100 label nInternalFaces_;
184 void calcCellShapes()
const;
187 void calcCellCells()
const;
190 void calcPointCells()
const;
193 void calcCells()
const;
196 void calcCellEdges()
const;
199 void calcPointPoints()
const;
204 void calcEdges(
const bool doFaceEdges)
const;
205 void clearOutEdges();
215 static label findFirstCommonElementFromSortedLists
406 static void calcCells
475 const bool report =
false,
482 const bool report =
false,
489 const bool report =
false,
496 const bool report =
false,
520 const bool report =
false,
533 const bool report =
false,
542 const bool report =
false,
549 const bool report =
false,
556 const bool report =
false,
557 const scalar minPyrVol = -small,
564 const bool report =
false,
565 const scalar maxSin = 10,
575 const scalar warnFlatness,
584 const scalar reportDistSqr,
592 const scalar minLenSqr,
599 const bool report =
false,
613 scalar inflationFraction = 0
746 namespace polyMeshCheck
Cell-face mesh analysis engine.
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
bool hasCellCells() const
bool hasCellShapes() const
primitiveMesh()
Construct null.
bool hasPointFaces() const
bool hasCellEdges() const
bool hasCellVolumes() const
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & cellEdges() const
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
bool hasPointPoints() const
bool checkClosedCells(const bool report=false, labelHashSet *setPtr=nullptr, labelHashSet *highAspectSetPtr=nullptr, const Vector< label > &solutionD=Vector< label >::one) const
Check cells for closedness.
const vectorField & faceCentres() const
bool checkFacePyramids(const bool report=false, const scalar minPyrVol=-small, labelHashSet *setPtr=nullptr) const
Check face pyramid volume.
virtual const faceList & faces() const =0
Return faces.
bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=nullptr) const
Check edge length.
bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=nullptr) const
Check cell zip-up.
const labelListList & pointCells() const
static const unsigned facesPerEdge_
Estimated number of faces per edge.
const scalarField & cellVolumes() const
bool checkFaceAreas(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for negative face areas.
void clearGeom()
Clear geometry.
bool hasFaceAreas() const
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
bool pointInCellBB(const point &p, label celli, scalar inflationFraction=0) const
Return true if the point in the cell bounding box.
bool checkFaceAngles(const bool report=false, const scalar maxSin=10, labelHashSet *setPtr=nullptr) const
Check face angles.
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
bool hasFaceCentres() const
bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face ordering.
bool checkConcaveCells(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for concave cells by the planes of faces.
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
static const unsigned edgesPerCell_
Estimated number of edges per cell.
const vectorField & cellCentres() const
bool hasPointCells() const
bool checkClosedBoundary(const bool report=false) const
Check boundary for closedness.
virtual ~primitiveMesh()
Destructor.
bool checkCellVolumes(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for negative cell volumes.
const cellShapeList & cellShapes() const
Return cell shapes.
static const unsigned facesPerPoint_
Estimated number of faces per point.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
bool checkDuplicateFaces(const label, const Map< label > &, label &nBaffleFaces, labelHashSet *) const
Check if all points on face are shared with another face.
label findCell(const point &location) const
Find cell enclosing this location (-1 if not in mesh)
void calcEdgeVectors() const
Calculate edge vectors.
static const unsigned pointsPerFace_
Estimated number of points per face.
ClassName("primitiveMesh")
bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=nullptr) const
Check uniqueness of face vertices.
const labelListList & cellCells() const
const labelListList & cellPoints() const
label nInternalFaces() const
void clearAddressing()
Clear topological data.
static const unsigned cellsPerPoint_
Estimated number of cells per point.
bool checkPoints(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for unused points.
bool hasCellCentres() const
bool hasCellPoints() const
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using.
void operator=(const primitiveMesh &)=delete
Disallow default bitwise assignment.
bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=nullptr) const
Check for point-point-nearness,.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
const scalarField & magFaceAreas() const
void printAllocated() const
Print a list of all the currently allocated mesh data.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
static const unsigned edgesPerPoint_
Estimated number of edges per point.
const labelListList & pointFaces() const
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
tmp< scalarField > movePoints(const pointField &p, const pointField &oldP)
Move points, returns volumes swept by faces in motion.
virtual const pointField & oldCellCentres() const =0
Return old cell centres for mesh motion.
static const unsigned pointsPerCell_
Estimated number of points per cell.
static const unsigned facesPerCell_
Estimated number of faces per cell.
bool hasFaceEdges() const
virtual const pointField & points() const =0
Return mesh points.
const labelListList & edgeFaces() const
const labelListList & pointPoints() const
const labelListList & faceEdges() const
const labelListList & edgeCells() const
const vectorField & faceAreas() const
bool hasEdgeCells() const
bool checkFaceFlatness(const bool report, const scalar warnFlatness, labelHashSet *setPtr) const
Check face warpage: decompose face and check ratio between.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
label nInternalPoints() const
Points not on boundary.
bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face-face connectivity.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
bool hasEdgeFaces() const
const cellList & cells() const
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas, scalarField &magfAreas) const
bool hasPointEdges() const
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
A class for managing temporary objects.
scalar closedThreshold
Data to control mesh checking.
scalar skewThreshold
Skewness warning threshold.
scalar aspectThreshold
Aspect ratio warning threshold.
scalar planarCosAngle
Threshold where faces are considered coplanar.
scalar nonOrthThreshold
Non-orthogonality warning threshold in deg.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const scalarField & cellVols