44 #ifndef Foam_polyMesh_H 45 #define Foam_polyMesh_H 70 class polyMeshTetDecomposition;
72 template<
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 490 const indexedOctree<treeDataCell>&
cellTree()
const;
551 return topoChanging_;
557 bool old(topoChanging_);
599 const bool validBoundary =
true 606 const bool validBoundary =
true 626 virtual bool init(
const bool doInit);
653 const bool validBoundary =
true 698 virtual bool checkFaceOrthogonality
700 const bool report =
false,
705 virtual bool checkFaceSkewness
707 const bool report =
false,
712 virtual bool checkEdgeAlignment
719 virtual bool checkCellDeterminant
729 const bool report =
false,
730 const bool detailedReport =
false 734 virtual bool checkFaceWeight
737 const scalar minWeight = 0.05,
742 virtual bool checkVolRatio
745 const scalar minRatio = 0.01,
writeOption
Enumeration defining write preferences.
polyMesh Mesh
The mesh type.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
void clearAddressing()
Clear topological data.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
A class for handling file names.
void updateGeomPoints(pointIOField &&newPoints, autoPtr< labelIOList > &newTetBasePtIsPtr)
Update geometry points; keep topology. Optionally with new face decomposition.
virtual void movePoints(const pointField &)
Move points.
const fileName & facesInstance() const
Return the current instance directory for faces.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
virtual void setUpToDatePoints(regIOobject &io) const
Set io to be up-to-date with points.
Cell-face mesh analysis engine.
void resetMotion() const
Reset motion.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
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.
Smooth ATC in cells having a point to a set of patches supplied by type.
A bounding box defined in terms of min/max extrema points.
const cellList & cells() const
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
label nFaces() const noexcept
Number of mesh faces.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
cellDecomposition
Enumeration defining the decomposition of the cell for.
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual const pointField & points() const
Return raw points.
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
vectorField pointField
pointField is a vectorField.
const fileName & pointsInstance() const
Return the current instance directory for points.
IOList< label > labelIOList
IO for a List of label.
void removeFiles() const
Remove all files from mesh instance()
void clearPrimitives()
Clear primitive data (points, faces and cells)
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
void findCellFacePt(const point &p, label &celli, label &tetFacei, label &tetPti) const
Find the cell, tetFacei and tetPti for point p.
static word defaultRegion
Return the default region name.
void addZones(PtrList< pointZone > &&pz, PtrList< faceZone > &&fz, PtrList< cellZone > &&cz)
Add mesh zones.
virtual const pointField & oldPoints() const
Return old points (mesh motion)
virtual const labelList & faceOwner() const
Return face owner.
label comm() const noexcept
Return communicator used for parallel communication.
const globalMeshData & globalData() const
Return parallel info.
ZoneMesh< pointZone, polyMesh > pointZoneMesh
A ZoneMesh with the type pointZone.
virtual const faceList & faces() const
Return raw faces.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
void clearGeom()
Clear geometry.
bool topoChanging() const noexcept
Is mesh topology changing.
void removeBoundary()
Remove boundary patches.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
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())
const scalarField & cellVols
void clearTetBasePtIs()
Clear tet base points.
bool changing() const noexcept
Is mesh changing (topology changing and/or moving)
const fileName & instance() const noexcept
Read access to instance path component.
label nSolutionD() const
Return the number of valid solved-for dimensions in the mesh.
virtual bool upToDatePoints(const regIOobject &io) const
Return true if io is up-to-date with points.
bool moving() const noexcept
Is mesh moving.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
TypeName("polyMesh")
Runtime type information.
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
virtual const pointField & oldCellCentres() const
Return old cellCentres (mesh motion)
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
const vectorField & faceAreas() const
const dimensionedScalar c
Speed of light in a vacuum.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Automatically write from objectRegistry::writeObject()
virtual bool dynamic() const
Is mesh dynamic.
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
polyBoundaryMesh BoundaryMesh
The boundary type associated with the mesh.
virtual ~polyMesh()
Destructor.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const objectRegistry & thisDb() const noexcept
Return the object registry.
bool hasTetBasePtIs() const
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const boundBox & bounds() const noexcept
Return mesh bounding box.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
readUpdateState
Enumeration defining the state of the mesh after a read update.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
Registry of regIOobjects.
void addPatches(polyPatchList &plist, const bool validBoundary=true)
Add boundary patches.
Defines the attributes of an object for which implicit objectRegistry management is supported...
A primitive field of type <T> with automated input and output.
void clearCellTree()
Clear cell tree data.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
virtual bool checkMeshMotion(const pointField &newPoints, const bool report=false, const bool detailedReport=false) const
Check mesh motion for correctness given motion points.