44 #ifndef Foam_polyMesh_H 45 #define Foam_polyMesh_H 72 class polyMeshTetDecomposition;
74 template<
class Type>
class indexedOctree;
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;
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.
label comm() const noexcept
The communicator used for parallel communication.
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.
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
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...
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")
Database for mesh data, solution data, solver performance and other reduced data. ...
virtual const meshState & data() const noexcept
Const reference to the mesh and solver state data.
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
A simple container for options an IOstream can normally have.
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.
List< face > faceList
List of faces.
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.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
bool hasGlobalData() const noexcept
Is demand-driven parallel info available?
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.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
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.
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.
List< label > labelList
A List of labels.
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.
objectRegistry(const Time &db, const label initialCapacity=128)
Construct the time objectRegistry, with estimated table capacity (default: 128)
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.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write items held in the objectRegistry. Normally includes mesh components (points, faces, etc) and any registered fields.