53#ifndef Foam_primitiveMesh_H
54#define Foam_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;
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
920#include "primitiveMeshI.H"
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A HashTable to objects of type <T> with a label key.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Smooth ATC in cells having a point to a set of patches supplied by type.
Cell-face mesh analysis engine.
bool hasPointCells() const noexcept
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
bool checkFaceOrthogonality(const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check for non-orthogonality.
bool hasPointPoints() const noexcept
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
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.
primitiveMesh()
Construct null.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
bool hasCellCells() const noexcept
static scalar planarCosAngle_
Threshold where faces are considered coplanar.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
const labelListList & cellEdges() const
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
const vectorField & faceCentres() const
virtual bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=nullptr) const
Check edge length.
bool hasFaceAreas() const noexcept
virtual bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=nullptr) const
Check cell zip-up.
static scalar skewThreshold_
Skewness warning threshold.
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
bool hasCellEdges() const noexcept
static scalar setNonOrthThreshold(const scalar)
Set the non-orthogonality warning threshold in degrees.
static const unsigned facesPerEdge_
Estimated number of faces per edge.
const scalarField & cellVolumes() const
virtual const faceList & faces() const =0
Return faces.
void clearGeom()
Clear geometry.
label nInternalFaces() const noexcept
Number of internal faces.
virtual bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
virtual bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
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 hasEdgeFaces() const noexcept
bool hasEdgeCells() const noexcept
bool hasCellVolumes() const noexcept
virtual bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face ordering.
bool hasCellCentres() const noexcept
static const unsigned edgesPerCell_
Estimated number of edges per cell.
bool hasPointFaces() const noexcept
bool hasCells() const noexcept
static scalar closedThreshold_
Static data to control mesh checking.
const vectorField & cellCentres() 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 checkFaceAngles(const pointField &points, const vectorField &faceAreas, const bool report, const scalar maxDeg, labelHashSet *setPtr) const
Check face angles.
static scalar nonOrthThreshold_
Non-orthogonality warning threshold in deg.
static scalar setSkewThreshold(const scalar)
Set the skewness warning threshold as percentage.
bool hasCellShapes() const noexcept
virtual ~primitiveMesh()
Destructor.
bool hasFaceCentres() const noexcept
const cellShapeList & cellShapes() const
Return cell shapes.
static scalar setAspectThreshold(const scalar)
Set the aspect ratio warning threshold.
static const unsigned facesPerPoint_
Estimated number of faces per point.
bool hasEdges() const noexcept
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
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.
label nPoints() const noexcept
Number of mesh points.
ClassName("primitiveMesh")
virtual bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=nullptr) const
Check uniqueness of face vertices.
bool checkCellVolumes(const scalarField &vols, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative cell volumes.
bool hasPointEdges() const noexcept
const labelListList & cellCells() const
label nInternalPoints() const noexcept
Points not on boundary.
const labelListList & cellPoints() const
bool checkFaceAreas(const vectorField &faceAreas, const bool report, const bool detailedReport, labelHashSet *setPtr) const
Check for negative face areas.
label nCells() const noexcept
Number of mesh cells.
void clearAddressing()
Clear topological data.
label nFaces() const noexcept
Number of mesh faces.
static const unsigned cellsPerPoint_
Estimated number of cells per point.
virtual bool checkPoints(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for unused points.
void clearCellGeom()
Clear cell-based geometry only.
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
bool checkFaceSkewness(const pointField &points, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs, const bool report, labelHashSet *setPtr) const
Check face skewness.
virtual bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=nullptr) const
Check for point-point-nearness,.
void printAllocated() const
Print a list of all the currently allocated mesh data.
void movePoints(const pointField &p, const pointField &oldP)
Move points.
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.
bool checkFaceFlatness(const pointField &points, const vectorField &faceCentres, const vectorField &faceAreas, const bool report, const scalar warnFlatness, labelHashSet *setPtr) const
Check face warpage.
const labelListList & pointFaces() const
static const unsigned pointsPerCell_
Estimated number of points per cell.
static const unsigned facesPerCell_
Estimated number of faces per cell.
const labelListList & edgeFaces() const
const labelListList & pointPoints() const
bool hasCellPoints() const noexcept
const labelListList & faceEdges() const
static scalar aspectThreshold_
Aspect ratio warning threshold.
const labelListList & edgeCells() const
const vectorField & faceAreas() const
bool checkConcaveCells(const vectorField &fAreas, const pointField &fCentres, const bool report, labelHashSet *setPtr) const
Check for concave cells by the planes of faces.
bool checkClosedBoundary(const vectorField &areas, const bool report, const bitSet &internalOrCoupledFaces) const
Check boundary for closedness.
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
bool hasFaceEdges() const noexcept
virtual bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face-face connectivity.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
virtual const pointField & points() const =0
Return mesh points.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
bool checkClosedCells(const vectorField &faceAreas, const scalarField &cellVolumes, const bool report, labelHashSet *setPtr, labelHashSet *aspectSetPtr, const Vector< label > &meshD) const
Check cells for closedness.
const cellList & cells() const
label nEdges() const
Number of mesh edges.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
virtual bool checkGeometry(const bool report=false) const
Check mesh geometry (& implicitly topology) for correctness.
label nInternal0Edges() const
static scalar setClosedThreshold(const scalar)
Set the closedness ratio warning threshold.
virtual void updateGeom()
Update all geometric data.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.