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_;
190 void calcCellShapes()
const;
193 void calcCellCells()
const;
196 void calcPointCells()
const;
199 void calcCells()
const;
202 void calcCellEdges()
const;
205 void calcPointPoints()
const;
210 void calcEdges(
const bool doFaceEdges)
const;
211 void clearOutEdges();
221 static label findFirstCommonElementFromSortedLists
318 const bool detailedReport,
327 const bool detailedReport,
346 const bool detailedReport,
347 const scalar minPyrVol,
383 const scalar warnFlatness,
540 static void calcCells
608 const bool report =
false,
615 const bool report =
false,
622 const bool report =
false,
629 const bool report =
false,
636 const bool report =
false,
650 const bool report =
false,
659 const bool report =
false,
666 const bool report =
false,
673 const bool report =
false,
680 const bool report =
false,
681 const scalar minPyrVol = -SMALL,
688 const bool report =
false,
695 const bool report =
false,
696 const scalar maxSin = 10,
706 const scalar warnFlatness,
715 const scalar reportDistSqr,
723 const scalar minLenSqr,
730 const bool report =
false,
744 virtual bool checkMesh(
const bool report =
false)
const;
769 scalar inflationFraction = 0
const labelListList & pointFaces() const
virtual bool checkPoints(const bool report=false, labelHashSet *setPtr=NULL) const
Check for unused points.
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
bool hasPointCells() const
A simple container for copying or transferring objects of type <T>.
void calcEdgeVectors() const
Calculate edge vectors.
static scalar aspectThreshold_
Aspect ratio warning threshold.
const labelListList & cellCells() const
ClassName("primitiveMesh")
virtual bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=NULL) const
Check for point-point-nearness,.
void clearAddressing()
Clear topological data.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool checkFaceSkewness(const pointField &points, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check face skewness.
bool hasPointEdges() const
const labelListList & pointPoints() const
void printAllocated() const
Print a list of all the currently allocated mesh data.
bool hasCellShapes() const
Cell-face mesh analysis engine.
const vectorField & faceAreas() const
bool hasPointPoints() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
bool hasEdgeFaces() const
bool checkFaceAreas(const vectorField &faceAreas, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative face areas.
const labelListList & cellPoints() const
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
static scalar setClosedThreshold(const scalar)
Set the closedness ratio warning threshold.
virtual const pointField & points() const =0
Return mesh points.
primitiveMesh()
Construct null.
bool checkFaceOrthogonality(const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check for non-orthogonality.
static const unsigned edgesPerPoint_
Estimated number of edges per point.
static const unsigned pointsPerCell_
Estimated number of points per cell.
const vectorField & faceCentres() const
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
bool checkFaceAngles(const pointField &points, const vectorField &faceAreas, const bool report, const scalar maxDeg, labelHashSet *setPtr) const
Check face angles.
virtual bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
const cellList & cells() const
bool checkDuplicateFaces(const label, const Map< label > &, label &nBaffleFaces, labelHashSet *) const
Check if all points on face are shared with another face.
bool checkClosedCells(const vectorField &faceAreas, const scalarField &cellVolumes, const bool report, labelHashSet *setPtr, labelHashSet *aspectSetPtr, const Vector< label > &meshD) const
Check cells for closedness.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
static const unsigned facesPerPoint_
Estimated number of faces per point.
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
static scalar setAspectThreshold(const scalar)
Set the aspect ratio warning threshold.
bool hasFaceAreas() const
const labelListList & edgeFaces() const
static scalar setSkewThreshold(const scalar)
Set the skewness warning threshold as percentage.
static const unsigned pointsPerFace_
Estimated number of points per face.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
bool checkClosedBoundary(const vectorField &, const bool, const PackedBoolList &) const
Check boundary for closedness.
const cellShapeList & cellShapes() const
Return cell shapes.
virtual bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=NULL) const
Check cell zip-up.
static const unsigned facesPerCell_
Estimated number of faces per cell.
void clearGeom()
Clear geometry.
tmp< scalarField > movePoints(const pointField &p, const pointField &oldP)
Move points, returns volumes swept by faces in motion.
const labelListList & pointCells() const
label nInternalPoints() const
Points not on boundary.
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using.
bool hasFaceCentres() const
static scalar closedThreshold_
Static data to control mesh checking.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
bool hasCellEdges() const
static const unsigned cellsPerPoint_
Estimated number of cells per point.
bool checkCellVolumes(const scalarField &vols, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative cell volumes.
bool hasPointFaces() const
bool hasCellCentres() const
const vectorField & cellCentres() const
virtual bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=NULL) const
Check uniqueness of face vertices.
const labelListList & pointEdges() const
bool checkFaceFlatness(const pointField &points, const vectorField &faceCentres, const vectorField &faceAreas, const bool report, const scalar warnFlatness, labelHashSet *setPtr) const
Check face warpage.
static scalar setNonOrthThreshold(const scalar)
Set the non-orthogonality warning threshold in degrees.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
static const unsigned facesPerEdge_
Estimated number of faces per edge.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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.
virtual bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
static const unsigned edgesPerCell_
Estimated number of edges per cell.
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
const labelListList & cellEdges() const
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
const scalarField & cellVols
const labelListList & edgeCells() const
const scalarField & cellVolumes() const
label findCell(const point &location) const
Find cell enclosing this location (-1 if not in mesh)
virtual ~primitiveMesh()
Destructor.
bool hasCellVolumes() const
bool pointInCellBB(const point &p, label celli, scalar inflationFraction=0) const
Return true if the point in the cell bounding box.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas) const
virtual bool checkGeometry(const bool report=false) const
Check mesh geometry (& implicitly topology) for correctness.
bool hasEdgeCells() const
virtual const faceList & faces() const =0
Return faces.
virtual const labelList & faceOwner() const =0
Face face-owner addresing.
bool hasFaceEdges() const
virtual bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=NULL) const
Check edge length.
static scalar skewThreshold_
Skewness warning threshold.
static scalar nonOrthThreshold_
Non-orthogonality warning threshold in deg.
virtual bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=NULL) const
Check face ordering.
bool hasCellCells() const
A class for managing temporary objects.
const labelListList & faceEdges() const
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 hasCellPoints() const
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
label nInternalFaces() const
bool checkConcaveCells(const vectorField &fAreas, const pointField &fCentres, const bool report, labelHashSet *setPtr) const
Check for concave cells by the planes of faces.
virtual bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=NULL) const
Check face-face connectivity.