44#ifndef Foam_polyMesh_H
45#define Foam_polyMesh_H
82 public objectRegistry,
139 bool clearedPrimitives_;
192 mutable bool storeOldCellCentres_;
195 mutable label curMotionTimeIndex_;
211 void operator=(
const polyMesh&) =
delete;
220 void calcDirections()
const;
224 void calcCellShapes()
const;
249 label& defaultPatchStart,
258 bool checkFaceOrthogonality
263 const bool detailedReport,
268 bool checkFaceSkewness
275 const bool detailedReport,
279 bool checkEdgeAlignment
287 bool checkCellDeterminant
301 const scalar minWeight,
309 const scalar minRatio,
353 const bool syncPar =
true
364 const bool syncPar =
true
376 const word& defaultBoundaryPatchName,
377 const word& defaultBoundaryPatchType,
378 const wordList& boundaryPatchPhysicalTypes,
379 const bool syncPar =
true
392 const word& defaultBoundaryPatchName,
393 const word& defaultBoundaryPatchType,
394 const bool syncPar =
true
507 const indexedOctree<treeDataCell>&
cellTree()
const;
567 bool moving(
const bool on)
noexcept
577 return topoChanging_;
583 bool old(topoChanging_);
625 const bool validBoundary =
true
632 const bool validBoundary =
true
652 virtual bool init(
const bool doInit);
679 const bool validBoundary =
true
700 void clearOut(
const bool isMeshUpdate =
false);
724 virtual bool checkFaceOrthogonality
726 const bool report =
false,
731 virtual bool checkFaceSkewness
733 const bool report =
false,
738 virtual bool checkEdgeAlignment
745 virtual bool checkCellDeterminant
755 const bool report =
false,
756 const bool detailedReport =
false
760 virtual bool checkFaceWeight
763 const scalar minWeight = 0.05,
768 virtual bool checkVolRatio
771 const scalar minRatio = 0.01,
821 const bool writeOnProc =
true
writeOption
Enumeration defining write preferences.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const fileName & instance() const noexcept
Read access to instance path component.
A simple container for options an IOstream can normally have.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bounding box defined in terms of min/max extrema points.
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
A class for handling file names.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Non-pointer based hierarchical recursive searching.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Database for mesh data, solution data, solver performance and other reduced data.
Smooth ATC in cells having a point to a set of patches supplied by type.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Tools for performing the minimum decomposition of faces of the mesh into triangles so that the cells ...
Mesh consisting of general polyhedral cells.
virtual ~polyMesh()
Destructor.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
void findCellFacePt(const point &p, label &celli, label &tetFacei, label &tetPti) const
Find the cell, tetFacei and tetPti for point p.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const fileName & facesInstance() const
Return the current instance directory for faces.
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
label & comm() noexcept
The communicator used for parallel communication.
bool hasGlobalData() const noexcept
Is demand-driven parallel info available?
static word defaultRegion
Return the default region name.
void addPatches(polyPatchList &plist, const bool validBoundary=true)
Add boundary patches.
cellZoneMesh & cellZones() noexcept
Return non-const access to the cellZones.
virtual meshState & data() noexcept
Reference to the mesh and solver state data.
polyMesh Mesh
The mesh type.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write items held in the objectRegistry. Normally includes mesh components (points,...
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir).
void clearCellTree()
Clear cell tree data.
virtual bool dynamic() const
Is mesh dynamic.
bool topoChanging(const bool on) noexcept
Set the mesh topology to be changing.
cellDecomposition
Enumeration defining the decomposition of the cell for.
bool hasTetBasePtIs() const
virtual const faceList & faces() const
Return raw faces.
bool moving() const noexcept
Is mesh moving.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
void clearGeom()
Clear geometry.
readUpdateState
Enumeration defining the state of the mesh after a read update.
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
virtual const labelList & faceOwner() const
Return face owner.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
virtual const meshState & data() const noexcept
Const reference to the mesh and solver state data.
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
TypeName("polyMesh")
Runtime type information.
const globalMeshData & globalData() const
Return parallel info (demand-driven).
void clearPrimitives()
Clear primitive data (points, faces and cells).
faceZoneMesh & faceZones() noexcept
Return non-const access to the faceZones.
bool topoChanging() const noexcept
Is mesh topology changing.
void updateGeomPoints(pointIOField &&newPoints, autoPtr< labelIOList > &newTetBasePtIsPtr)
Update geometry points; keep topology. Optionally with new face decomposition.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
label nSolutionD() const
Return the number of valid solved-for dimensions in the mesh.
bool moving(const bool on) noexcept
Set the mesh to be moving.
polyBoundaryMesh BoundaryMesh
The boundary type associated with the mesh.
virtual const pointField & oldPoints() const
Return old points (mesh motion).
const fileName & pointsInstance() const
Return the current instance directory for points.
void resetMotion() const
Reset motion.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
void addZones(PtrList< pointZone > &&pz, PtrList< faceZone > &&fz, PtrList< cellZone > &&cz)
Add mesh zones.
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual bool upToDatePoints(const regIOobject &io) const
Return true if io is up-to-date with points.
void clearTetBasePtIs()
Clear tet base points.
virtual void movePoints(const pointField &)
Move points.
pointZoneMesh & pointZones() noexcept
Return non-const access to the pointZones.
label comm() const noexcept
The communicator used for parallel communication.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
const objectRegistry & thisDb() const noexcept
Return the object registry.
const boundBox & bounds() const noexcept
Return mesh bounding box.
virtual const pointField & points() const
Return raw points.
virtual void setUpToDatePoints(regIOobject &io) const
Set io to be up-to-date with points.
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
void removeFiles() const
Remove all files from mesh instance().
void removeBoundary()
Remove boundary patches.
virtual const pointField & oldCellCentres() const
Return old cellCentres (mesh motion).
bool changing() const noexcept
Is mesh changing (topology changing and/or moving).
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh").
void resetPrimitives(autoPtr< pointField > &&points, autoPtr< faceList > &&faces, autoPtr< labelList > &&owner, autoPtr< labelList > &&neighbour, const labelUList &patchSizes, const labelUList &patchStarts, const bool validBoundary=true)
Reset mesh primitive data. Assumes all patch info correct.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
virtual bool checkMeshMotion(const pointField &newPoints, const bool report=false, const bool detailedReport=false) const
Check mesh motion for correctness given motion points.
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
void clearAddressing()
Clear topological data.
label nFaces() const noexcept
Number of mesh faces.
const vectorField & faceAreas() const
const cellList & cells() const
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e....
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Info<< "Creating cells"<< endl;cellShapes=b.shapes();Info<< "Creating boundary faces"<< endl;boundary.setSize(b.boundaryPatches().size());forAll(boundary, patchi) { faceList faces(b.boundaryPatches()[patchi].size());forAll(faces, facei) { faces[facei]=face(b.boundaryPatches()[patchi][facei]);} boundary[patchi].transfer(faces);} points.transfer(const_cast< pointField & >(b.points()));}Info<< "Creating patch dictionaries"<< endl;wordList patchNames(boundary.size());forAll(patchNames, patchi){ patchNames[patchi]=polyPatch::defaultName(patchi);}PtrList< dictionary > boundaryDicts(boundary.size())
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< word > wordList
List of word.
ZoneMesh< pointZone, polyMesh > pointZoneMesh
A ZoneMesh with pointZone content on a polyMesh.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
IOList< label > labelIOList
IO for a List of label.
CompactIOList< face > faceCompactIOList
Compact IO for a List of face.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with faceZone content on a polyMesh.
List< face > faceList
List of faces.
vectorIOField pointIOField
pointIOField is a vectorIOField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< cell > cellList
List of cell.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with cellZone content on a polyMesh.
List< faceList > faceListList
List of faceList.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
List< cellShape > cellShapeList
List of cellShape.
const scalarField & cellVols
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.