44 #ifndef Foam_polyMesh_H 45 #define Foam_polyMesh_H 71 class polyMeshTetDecomposition;
73 template<
class Type>
class indexedOctree;
138 bool clearedPrimitives_;
191 mutable bool storeOldCellCentres_;
194 mutable label curMotionTimeIndex_;
210 void operator=(
const polyMesh&) =
delete;
219 void calcDirections()
const;
223 void calcCellShapes()
const;
248 label& defaultPatchStart,
257 bool checkFaceOrthogonality
262 const bool detailedReport,
267 bool checkFaceSkewness
274 const bool detailedReport,
278 bool checkEdgeAlignment
286 bool checkCellDeterminant
300 const scalar minWeight,
308 const scalar minRatio,
352 const bool syncPar =
true 363 const bool syncPar =
true 375 const word& defaultBoundaryPatchName,
376 const word& defaultBoundaryPatchType,
377 const wordList& boundaryPatchPhysicalTypes,
378 const bool syncPar =
true 391 const word& defaultBoundaryPatchName,
392 const word& defaultBoundaryPatchType,
393 const bool syncPar =
true 506 const indexedOctree<treeDataCell>&
cellTree()
const;
576 return topoChanging_;
582 bool old(topoChanging_);
624 const bool validBoundary =
true 631 const bool validBoundary =
true 651 virtual bool init(
const bool doInit);
678 const bool validBoundary =
true 723 virtual bool checkFaceOrthogonality
725 const bool report =
false,
730 virtual bool checkFaceSkewness
732 const bool report =
false,
737 virtual bool checkEdgeAlignment
744 virtual bool checkCellDeterminant
754 const bool report =
false,
755 const bool detailedReport =
false 759 virtual bool checkFaceWeight
762 const scalar minWeight = 0.05,
767 virtual bool checkVolRatio
770 const scalar minRatio = 0.01,
820 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.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
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.
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.