Go to the documentation of this file.
50 #ifndef primitiveMesh_H
51 #define primitiveMesh_H
210 void calcEdges(
const bool doFaceEdges)
const;
318 const bool detailedReport,
327 const bool detailedReport,
346 const bool detailedReport,
347 const scalar minPyrVol,
379 const scalar warnFlatness,
604 const bool report =
false,
611 const bool report =
false,
618 const bool report =
false,
625 const bool report =
false,
632 const bool report =
false,
646 const bool report =
false,
655 const bool report =
false,
662 const bool report =
false,
669 const bool report =
false,
676 const bool report =
false,
677 const scalar minPyrVol = -SMALL,
684 const bool report =
false,
691 const bool report =
false,
692 const scalar maxSin = 10,
702 const scalar warnFlatness,
711 const scalar reportDistSqr,
719 const scalar minLenSqr,
726 const bool report =
false,
740 virtual bool checkMesh(
const bool report =
false)
const;
765 scalar inflationFraction = 0
void printAllocated() const
Print a list of all the currently allocated mesh data.
labelListList * fePtr_
Face-edges.
void clearGeom()
Clear geometry.
bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=NULL) const
Check for point-point-nearness,.
label nCells_
Number of cells.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas) const
labelListList * pePtr_
Point-edges.
bool hasPointEdges() const
static scalar skewThreshold_
Skewness warning threshold.
label nInternal1Edges_
Number of internal edges using 0 or 1 boundary points.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
virtual const pointField & points() const =0
Return mesh points.
primitiveMesh()
Construct null.
labelListList * ppPtr_
Point-points.
static const unsigned pointsPerFace_
Estimated number of points per face.
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.
virtual const faceList & faces() const =0
Return faces.
static const unsigned facesPerCell_
Estimated number of faces per cell.
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using.
const labelListList & edgeFaces() const
bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=NULL) const
Check uniqueness of face vertices.
const labelListList & pointFaces() const
virtual const labelList & faceOwner() const =0
Face face-owner addresing.
static scalar setSkewThreshold(const scalar)
Set the skewness warning threshold as percentage.
void calcCells() const
Calculate cell-face addressing.
const cellList & cells() const
bool pointInCell(const point &p, label celli) const
Is the point 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.
labelHashSet labelSet_
Temporary storage for addressing.
labelListList * ecPtr_
Edge-cells.
bool hasCellVolumes() const
scalarField * cellVolumesPtr_
Cell volumes.
bool hasCellEdges() const
static scalar aspectThreshold_
Aspect ratio warning threshold.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
const labelListList & pointEdges() const
labelListList * pfPtr_
Point-faces.
label nEdges_
Number of edges.
bool checkFaceAreas(const bool report=false, labelHashSet *setPtr=NULL) const
Check for negative face areas.
label nInternal0Edges_
Number of internal edges using 0 boundary points.
A simple container for copying or transferring objects of type <T>.
static const unsigned edgesPerPoint_
Estimated number of edges per point.
void calcEdges() const
Calculate edges, pointEdges and faceEdges.
bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
static const unsigned facesPerEdge_
Estimated number of faces per edge.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
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.
void calcCellEdges() const
Calculate edge list.
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.
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.
void calcCellCells() const
Calculate cell-cell addressing.
bool checkFaceFlatness(const bool report, labelHashSet *setPtr) const
Check face warpage: decompose face and check ratio between.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
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
bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=NULL) const
Check edge length.
bool hasCellCentres() const
static scalar nonOrthThreshold_
Non-orthogonality warning threshold in deg.
const labelListList & faceEdges() const
const labelListList & cellCells() const
bool checkFaceOrthogonality(const bool report=false, labelHashSet *setPtr=NULL) const
Check for non-orthogonality.
label nInternalFaces_
Number of internal faces.
const scalarField & cellVols
vectorField * faceCentresPtr_
Face centres.
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
labelListList * pcPtr_
Point-cells.
cellList * cfPtr_
Cell-faces.
const labelListList & edgeCells() const
cellShapeList * cellShapesPtr_
Cell shapes.
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
labelListList * ccPtr_
Cell-cells.
label nInternalFaces() const
void clearOutEdges()
During edge calculation, a larger set of data is assembled.
static const debug::tolerancesSwitch aspectThreshold_
Aspect ratio warning threshold.
ClassName("primitiveMesh")
bool checkClosedBoundary(const bool report=false) const
Check boundary for closedness.
bool checkFaceSkewness(const bool report=false, labelHashSet *setPtr=NULL) const
Check face skewness.
static label findFirstCommonElementFromSortedLists(const labelList &, const labelList &)
For on-the-fly addressing calculation.
label nInternalPoints() const
Points not on boundary.
void calcPointCells() const
Calculate point-cell addressing.
const scalarField & cellVolumes() const
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
const cellShapeList & cellShapes() const
Return cell shapes.
bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=NULL) const
Check face ordering.
bool hasFaceAreas() const
bool hasFaceCentres() const
dynamicLabelList labels_
Temporary storage for addressing.
static const unsigned edgesPerCell_
Estimated number of edges per cell.
bool hasEdgeCells() const
static const debug::tolerancesSwitch closedThreshold_
Static data to control mesh checking.
bool hasPointPoints() const
bool checkClosedCells(const bool report=false, labelHashSet *setPtr=NULL, labelHashSet *highAspectSetPtr=NULL) const
Check cells for closedness.
const vectorField & cellCentres() const
labelListList * cpPtr_
Cell-points.
static Foam::debug::tolerancesSwitch nonOrthThreshold_
Non-orthogonality warning threshold in deg.
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
bool checkFaceAngles(const bool report=false, labelHashSet *setPtr=NULL) const
Check face angles.
static scalar planarCosAngle_
Threshold where faces are considered coplanar.
static scalar setAspectThreshold(const scalar)
Set the aspect ratio warning threshold.
static const unsigned facesPerPoint_
Estimated number of faces per point.
label nPoints_
Number of points.
static const debug::tolerancesSwitch skewThreshold_
Skewness warning threshold.
vectorField * faceAreasPtr_
Face areas.
bool checkCellVolumes(const bool report=false, labelHashSet *setPtr=NULL) const
Check for negative cell volumes.
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
bool checkPoints(const bool report=false, labelHashSet *setPtr=NULL) const
Check for unused points.
labelListList * cePtr_
Cell-edges.
labelListList * efPtr_
Edge-faces.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=NULL) const
Check face-face connectivity.
const vectorField & faceCentres() const
edgeList * edgesPtr_
Edges are ordered in upper triangular order.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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 calcCellShapes() const
Calculate cell shapes.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
label nFaces_
Number of faces.
static label getEdge(List< dynamicLabelList > &, DynamicList< edge > &, const label, const label)
Helper:
label nInternalEdges_
Number of internal edges using 0,1 or 2boundary points.
bool hasCellCells() const
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
bool pointInCellBB(const point &p, label celli) const
Is the point in the cell bounding box.
vectorField * cellCentresPtr_
Cell centres.
bool hasPointCells() const
void calcPointPoints() const
Calculate point-point addressing.
bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=NULL) const
Check cell zip-up.
static const unsigned cellsPerPoint_
Estimated number of cells per point.
DynamicList< label > labels_
Temporary storage for addressing.
bool hasPointFaces() const
label nInternalPoints_
Number of internal points (or -1 if points not sorted)
static const unsigned pointsPerCell_
Estimated number of points per cell.
bool checkFacePyramids(const bool report=false, const scalar minPyrVol=-SMALL, labelHashSet *setPtr=NULL) const
Check face pyramid volume.
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
bool hasCellPoints() const
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
const labelListList & pointPoints() const
void operator=(const primitiveMesh &)
Disallow default bitwise assignment.
const vectorField & faceAreas() const
Cell-face mesh analysis engine.