44#ifndef Foam_polyMesh_H
45#define Foam_polyMesh_H
70class polyMeshTetDecomposition;
72template<
class Type>
class indexedOctree;
133 bool clearedPrimitives_;
186 mutable bool storeOldCellCentres_;
189 mutable label curMotionTimeIndex_;
205 void operator=(
const polyMesh&) =
delete;
214 void calcDirections()
const;
218 void calcCellShapes()
const;
243 label& defaultPatchStart,
252 bool checkFaceOrthogonality
257 const bool detailedReport,
262 bool checkFaceSkewness
269 const bool detailedReport,
273 bool checkEdgeAlignment
281 bool checkCellDeterminant
295 const scalar minWeight,
303 const scalar minRatio,
346 const bool syncPar =
true
357 const bool syncPar =
true
369 const word& defaultBoundaryPatchName,
370 const word& defaultBoundaryPatchType,
371 const wordList& boundaryPatchPhysicalTypes,
372 const bool syncPar =
true
385 const word& defaultBoundaryPatchName,
386 const word& defaultBoundaryPatchType,
387 const bool syncPar =
true
541 bool moving(
const bool on)
noexcept
551 return topoChanging_;
557 bool old(topoChanging_);
599 const bool validBoundary =
true
606 const bool validBoundary =
true
618 virtual bool init(
const bool doInit);
645 const bool validBoundary =
true
690 virtual bool checkFaceOrthogonality
692 const bool report =
false,
697 virtual bool checkFaceSkewness
699 const bool report =
false,
704 virtual bool checkEdgeAlignment
711 virtual bool checkCellDeterminant
721 const bool report =
false,
722 const bool detailedReport =
false
726 virtual bool checkFaceWeight
729 const scalar minWeight = 0.05,
734 virtual bool checkVolRatio
737 const scalar minRatio = 0.01,
A primitive field of type <T> with automated input and output.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
fileName & instance() noexcept
Write access to instance path component.
writeOption
Enumeration defining the write options.
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.
Registry of regIOobjects.
Smooth ATC in cells having a point to a set of patches supplied by type.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Mesh consisting of general polyhedral cells.
virtual ~polyMesh()
Destructor.
void findCellFacePt(const point &p, label &celli, label &tetFacei, label &tetPti) const
Find the cell, tetFacei and tetPti for point p.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
const fileName & facesInstance() const
Return the current instance directory for faces.
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
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.
label comm() const noexcept
Return communicator used for parallel communication.
polyMesh Mesh
The mesh type.
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.
const boundBox & bounds() const
Return mesh bounding box.
virtual const labelList & faceOwner() const
Return face owner.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
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.
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)
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.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void resetMotion() const
Reset motion.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
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.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
pointZoneMesh & pointZones() noexcept
Return non-const access to the pointZones.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
const objectRegistry & thisDb() const noexcept
Return the object registry.
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.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
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.
Cell-face mesh analysis engine.
void clearAddressing()
Clear topological data.
label nFaces() const noexcept
Number of mesh faces.
const vectorField & faceAreas() const
const cellList & cells() const
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
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())
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
const scalarField & cellVols
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.