Go to the documentation of this file.
53 #ifndef primitiveMesh_H
54 #define primitiveMesh_H
69 #include "tolerancesSwitch.H"
153 mutable dynamicLabelList
labels_;
491 const bool report =
false,
498 const bool report =
false,
505 const bool report =
false,
512 const bool report =
false,
525 const bool report =
false,
533 const bool report =
false,
540 const bool report =
false,
547 const bool report =
false,
554 const bool report =
false,
555 const scalar minPyrVol = -SMALL,
562 const bool report =
false,
569 const bool report =
false,
593 const bool report =
false,
602 const scalar reportDistSqr,
610 const scalar minLenSqr,
617 const bool report =
false,
631 bool checkMesh(
const bool report =
false)
const;
637 const bool report =
false
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
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
virtual const faceList & faces() const =0
Return faces.
static const unsigned facesPerCell_
Estimated number of faces per cell.
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.
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
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.
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
label nEdges_
Number of edges.
bool checkFaceAreas(const bool report=false, labelHashSet *setPtr=NULL) const
Check for negative face areas.
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
void calcCellEdges() const
Calculate edge list.
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.
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
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.
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.
void calcPointCells() const
Calculate point-cell addressing.
const scalarField & cellVolumes() const
const cellShapeList & cellShapes() const
Return cell shapes.
bool checkEdgeAlignment(const bool report, const Vector< label > &directions, labelHashSet *setPtr=NULL) const
Check edge alignment for 1D/2D cases.
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.
bool checkCellDeterminant(const bool report=false, labelHashSet *setPtr=NULL) const
Check cell determinant.
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 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:
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 calcPointEdges() const
Calculate point-edge addressing.
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.
static const debug::tolerancesSwitch faceFlatnessThreshold_
Face flatness threshold.
bool hasPointFaces() const
static Foam::debug::tolerancesSwitch faceAngleThreshold_
Face angle threshold.
bool checkMeshMotion(const pointField &newPoints, const bool report=false) const
Check mesh motion for correctness given motion points.
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.