OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

polyMesh Class Reference

Mesh consisting of general polyhedral cells. More...

Inheritance diagram for polyMesh:
Collaboration diagram for polyMesh:

List of all members.


Public Types

enum  readUpdateState { UNCHANGED, POINTS_MOVED, TOPO_CHANGE, TOPO_PATCH_CHANGE }
 Enumeration defining the state of the mesh after a read update. More...
typedef polyMesh Mesh
typedef polyBoundaryMesh BoundaryMesh

Public Member Functions

 TypeName ("polyMesh")
 Runtime type information.
 polyMesh (const IOobject &io)
 Construct from IOobject.
 polyMesh (const IOobject &io, const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< labelList > &owner, const Xfer< labelList > &neighbour, const bool syncPar=true)
 Construct without boundary from components.
 polyMesh (const IOobject &io, const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< cellList > &cells, const bool syncPar=true)
 Construct without boundary with cells rather than owner/neighbour.
 polyMesh (const IOobject &io, const Xfer< pointField > &points, const cellShapeList &shapes, const faceListList &boundaryFaces, const wordList &boundaryPatchNames, const wordList &boundaryPatchTypes, const word &defaultBoundaryPatchName, const word &defaultBoundaryPatchType, const wordList &boundaryPatchPhysicalTypes, const bool syncPar=true)
 Construct from cell shapes.
virtual ~polyMesh ()
virtual const fileNamedbDir () const
 Override the objectRegistry dbDir for a single-region case.
fileName meshDir () const
 Return the local mesh directory (dbDir()/meshSubDir).
const fileNamepointsInstance () const
 Return the current instance directory for points.
const fileNamefacesInstance () const
 Return the current instance directory for faces.
void setInstance (const fileName &)
 Set the instance for mesh files.
virtual const pointFieldpoints () const
 Return raw points.
virtual const faceListfaces () const
 Return raw faces.
virtual const labelListfaceOwner () const
 Return face owner.
virtual const labelListfaceNeighbour () const
 Return face neighbour.
virtual const pointFieldoldPoints () const
 Return old points for mesh motion.
const polyBoundaryMeshboundaryMesh () const
 Return boundary mesh.
const boundBoxbounds () const
 Return mesh bounding box.
const Vector< label > & geometricD () const
 Return the vector of geometric directions in mesh.
label nGeometricD () const
 Return the number of valid geometric dimensions in the mesh.
const Vector< label > & solutionD () const
 Return the vector of solved-for directions in mesh.
label nSolutionD () const
 Return the number of valid solved-for dimensions in the mesh.
const pointZoneMeshpointZones () const
 Return point zone mesh.
const faceZoneMeshfaceZones () const
 Return face zone mesh.
const cellZoneMeshcellZones () const
 Return cell zone mesh.
const globalMeshDataglobalData () const
 Return parallel info.
const objectRegistrythisDb () const
 Return the object registry.
bool moving () const
 Is mesh moving.
bool moving (const bool m)
 Set the mesh to be moving.
bool changing () const
 Is mesh changing (topology changing and/or moving).
bool changing (const bool c)
 Set the mesh to be changing.
virtual tmp< scalarFieldmovePoints (const pointField &)
 Move points, returns volumes swept by faces in motion.
void resetMotion () const
 Reset motion.
pointZoneMeshpointZones ()
 Return non-const access to the pointZones.
faceZoneMeshfaceZones ()
 Return non-const access to the faceZones.
cellZoneMeshcellZones ()
 Return non-const access to the cellZones.
void addPatches (const List< polyPatch * > &, const bool validBoundary=true)
 Add boundary patches.
void addZones (const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
 Add mesh zones.
virtual readUpdateState readUpdate ()
 Update the mesh based on the mesh files saved in.
virtual void updateMesh (const mapPolyMesh &mpm)
 Update the mesh corresponding to given map.
void removeBoundary ()
 Remove boundary patches.
void resetPrimitives (const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< labelList > &owner, const Xfer< labelList > &neighbour, const labelList &patchSizes, const labelList &patchStarts, const bool validBoundary=true)
 Reset mesh primitive data. Assumes all patch info correct.
void clearGeom ()
 Clear geometry.
void clearAddressing ()
 Clear addressing.
void clearOut ()
 Clear all geometry and addressing unnecessary for CFD.
void clearPrimitives ()
 Clear primitive data (points, faces and cells).
void removeFiles (const fileName &instanceDir) const
 Remove all files from mesh instance.
void removeFiles () const
 Remove all files from mesh instance().

Static Public Attributes

static word defaultRegion = "region0"
 Return the default region name.
static word meshSubDir = "polyMesh"
 Return the mesh sub-directory name (usually "polyMesh").

Detailed Description

Mesh consisting of general polyhedral cells.

Source files

Definition at line 65 of file polyMesh.H.


Member Typedef Documentation

typedef polyMesh Mesh

Reimplemented in fvMesh.

Definition at line 206 of file polyMesh.H.

Reimplemented in fvMesh.

Definition at line 207 of file polyMesh.H.


Member Enumeration Documentation

Enumeration defining the state of the mesh after a read update.

Used for post-processing applications, where the mesh needs to update based on the files written in time directores

Enumerator:
UNCHANGED 
POINTS_MOVED 
TOPO_CHANGE 
TOPO_PATCH_CHANGE 

Definition at line 81 of file polyMesh.H.


Constructor & Destructor Documentation

polyMesh ( const IOobject io  )  [explicit]

Construct from IOobject.

Definition at line 127 of file polyMesh.C.

polyMesh ( const IOobject io,
const Xfer< pointField > &  points,
const Xfer< faceList > &  faces,
const Xfer< labelList > &  owner,
const Xfer< labelList > &  neighbour,
const bool  syncPar = true 
)

Construct without boundary from components.

Boundary is added using addPatches() member function

Definition at line 303 of file polyMesh.C.

References Foam::endl(), and WarningIn.

Here is the call graph for this function:

polyMesh ( const IOobject io,
const Xfer< pointField > &  points,
const Xfer< faceList > &  faces,
const Xfer< cellList > &  cells,
const bool  syncPar = true 
)

Construct without boundary with cells rather than owner/neighbour.

Boundary is added using addPatches() member function

Definition at line 460 of file polyMesh.C.

polyMesh ( const IOobject io,
const Xfer< pointField > &  points,
const cellShapeList shapes,
const faceListList boundaryFaces,
const wordList boundaryPatchNames,
const wordList boundaryPatchTypes,
const word defaultBoundaryPatchName,
const word defaultBoundaryPatchType,
const wordList boundaryPatchPhysicalTypes,
const bool  syncPar = true 
)

Construct from cell shapes.

Definition at line 129 of file polyMeshFromShapeMesh.C.

~polyMesh (  )  [virtual]

Definition at line 760 of file polyMesh.C.


Member Function Documentation

TypeName ( "polyMesh"   ) 

Runtime type information.

const Foam::fileName & dbDir (  )  const [virtual]

Override the objectRegistry dbDir for a single-region case.

Reimplemented from objectRegistry.

Definition at line 769 of file polyMesh.C.

References polyMesh::clearOut(), and polyMesh::resetMotion().

Here is the call graph for this function:

Foam::fileName meshDir (  )  const

Return the local mesh directory (dbDir()/meshSubDir).

Definition at line 782 of file polyMesh.C.

const Foam::fileName & pointsInstance (  )  const

Return the current instance directory for points.

Used in the consruction of gemometric mesh data dependent on points

Definition at line 788 of file polyMesh.C.

const Foam::fileName & facesInstance (  )  const

Return the current instance directory for faces.

Definition at line 794 of file polyMesh.C.

void setInstance ( const fileName inst  ) 

Set the instance for mesh files.

Definition at line 24 of file polyMeshIO.C.

References IOobject::AUTO_WRITE, Foam::endl(), Foam::Info, IOobject::instance(), and IOobject::writeOpt().

Referenced by meshRefinement::mergePatchFaces(), Foam::polyMeshZipUpCells(), and polyMesh::updateMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

const Foam::pointField & points (  )  const [virtual]

Return raw points.

Implements primitiveMesh.

Definition at line 947 of file polyMesh.C.

Referenced by Foam::polyMeshZipUpCells(), interactionLists::testEdgeEdgeDistance(), and interactionLists::testPointFaceDistance().

Here is the caller graph for this function:

const Foam::faceList & faces (  )  const [virtual]

Return raw faces.

Implements primitiveMesh.

Definition at line 960 of file polyMesh.C.

Referenced by hexRef8::getSplitPoints(), Particle< ParticleType >::lambda(), and Foam::polyMeshZipUpCells().

Here is the caller graph for this function:

const Foam::labelList & faceNeighbour (  )  const [virtual]

Return face neighbour.

Implements primitiveMesh.

Definition at line 979 of file polyMesh.C.

Referenced by addPatchCellLayer::addedCells(), removeFaces::compatibleRemoves(), hexRef8::consistentSlowRefinement(), hexRef8::consistentUnrefinement(), and removeCells::getExposedFaces().

Here is the caller graph for this function:

const Foam::pointField & oldPoints (  )  const [virtual]

Return old points for mesh motion.

Implements primitiveMesh.

Definition at line 986 of file polyMesh.C.

Referenced by Particle< ParticleType >::lambda().

Here is the caller graph for this function:

const boundBox& bounds (  )  const [inline]

Return mesh bounding box.

Definition at line 321 of file polyMesh.H.

Referenced by NamedEnum< Enum, nEnum >::names().

Here is the caller graph for this function:

const Foam::Vector< Foam::label > & geometricD (  )  const

Return the vector of geometric directions in mesh.

Defined according to the presence of empty and wedge patches. 1 indicates unconstrained direction and -1 a constrained direction.

Definition at line 800 of file polyMesh.C.

Foam::label nGeometricD (  )  const

Return the number of valid geometric dimensions in the mesh.

Definition at line 811 of file polyMesh.C.

const Foam::Vector< Foam::label > & solutionD (  )  const

Return the vector of solved-for directions in mesh.

Differs from geometricD in that it includes for wedge cases the circumferential direction in case of swirl. 1 indicates valid direction and -1 an invalid direction.

Definition at line 817 of file polyMesh.C.

Referenced by polyMesh::addPatches().

Here is the caller graph for this function:

Foam::label nSolutionD (  )  const

Return the number of valid solved-for dimensions in the mesh.

Definition at line 828 of file polyMesh.C.

const pointZoneMesh& pointZones (  )  const [inline]

Return point zone mesh.

Definition at line 349 of file polyMesh.H.

Referenced by NamedEnum< Enum, nEnum >::names().

Here is the caller graph for this function:

const faceZoneMesh& faceZones (  )  const [inline]

Return face zone mesh.

Definition at line 355 of file polyMesh.H.

Referenced by Foam::polyMeshZipUpCells(), and autoSnapDriver::repatchToSurface().

Here is the caller graph for this function:

const cellZoneMesh& cellZones (  )  const [inline]

Return cell zone mesh.

Definition at line 361 of file polyMesh.H.

Referenced by porousZone::modifyDdt().

Here is the caller graph for this function:

const Foam::globalMeshData & globalData (  )  const

Return parallel info.

Definition at line 1101 of file polyMesh.C.

References Foam::deleteDemandDrivenData().

Referenced by hexRef8::consistentSlowRefinement(), meshRefinement::refineCandidates(), syncTools::syncEdgeList(), and syncTools::syncPointList().

Here is the call graph for this function:

Here is the caller graph for this function:

const objectRegistry& thisDb (  )  const [inline]

Return the object registry.

Reimplemented in fvMesh.

Definition at line 370 of file polyMesh.H.

Referenced by polyMesh::updateMesh().

Here is the caller graph for this function:

bool moving (  )  const [inline]

Is mesh moving.

Definition at line 378 of file polyMesh.H.

Referenced by Foam::MULES::explicitSolve(), EulerD2dt2Scheme< Type >::fvcD2dt2(), EulerDdtScheme< Type >::fvcDdt(), and Particle< ParticleType >::lambda().

Here is the caller graph for this function:

bool moving ( const bool  m  )  [inline]

Set the mesh to be moving.

Definition at line 384 of file polyMesh.H.

bool changing (  )  const [inline]

Is mesh changing (topology changing and/or moving).

Definition at line 393 of file polyMesh.H.

Referenced by RASModel::read().

Here is the caller graph for this function:

bool changing ( const bool  c  )  [inline]

Set the mesh to be changing.

Definition at line 399 of file polyMesh.H.

Foam::tmp< Foam::scalarField > movePoints ( const pointField newPoints  )  [virtual]

Move points, returns volumes swept by faces in motion.

Reimplemented in fvMesh.

Definition at line 1006 of file polyMesh.C.

void resetMotion (  )  const

Reset motion.

Definition at line 1093 of file polyMesh.C.

Referenced by polyMesh::dbDir().

Here is the caller graph for this function:

pointZoneMesh& pointZones (  )  [inline]

Return non-const access to the pointZones.

Definition at line 416 of file polyMesh.H.

faceZoneMesh& faceZones (  )  [inline]

Return non-const access to the faceZones.

Definition at line 422 of file polyMesh.H.

cellZoneMesh& cellZones (  )  [inline]

Return non-const access to the cellZones.

Definition at line 428 of file polyMesh.H.

void addPatches ( const List< polyPatch * > &  p,
const bool  validBoundary = true 
)

Add boundary patches.

Definition at line 836 of file polyMesh.C.

References Foam::cmptSum(), and polyMesh::solutionD().

Here is the call graph for this function:

void addZones ( const List< pointZone * > &  pz,
const List< faceZone * > &  fz,
const List< cellZone * > &  cz 
)

Add mesh zones.

Definition at line 883 of file polyMesh.C.

Foam::polyMesh::readUpdateState readUpdate (  )  [virtual]

Update the mesh based on the mesh files saved in.

time directories

Reimplemented in fvMesh.

Definition at line 58 of file polyMeshIO.C.

void updateMesh ( const mapPolyMesh mpm  )  [virtual]

Update the mesh corresponding to given map.

Reimplemented in fvMesh.

Definition at line 30 of file polyMeshUpdate.C.

References objectRegistry::foundObject(), objectRegistry::lookupObject(), mapPolyMesh::pointMap(), polyMesh::setInstance(), polyMesh::thisDb(), objectRegistry::time(), timeName, globalMeshData::updateMesh(), and polyBoundaryMesh::updateMesh().

Here is the call graph for this function:

void removeBoundary (  ) 

Remove boundary patches.

Definition at line 27 of file polyMeshClear.C.

References Foam::endl(), and Foam::Info.

Here is the call graph for this function:

void resetPrimitives ( const Xfer< pointField > &  points,
const Xfer< faceList > &  faces,
const Xfer< labelList > &  owner,
const Xfer< labelList > &  neighbour,
const labelList patchSizes,
const labelList patchStarts,
const bool  validBoundary = true 
)

Reset mesh primitive data. Assumes all patch info correct.

(so does e.g. parallel communication). If not use validBoundary=false (still assumes patchStarts[0] = nInternalFaces and last patch ends at nActiveFaces) and change patches with addPatches.

Definition at line 641 of file polyMesh.C.

Referenced by Foam::polyMeshZipUpCells().

Here is the caller graph for this function:

void clearGeom (  ) 

Clear geometry.

Reimplemented from primitiveMesh.

Definition at line 46 of file polyMeshClear.C.

void clearAddressing (  ) 

Clear addressing.

Reimplemented from primitiveMesh.

Definition at line 70 of file polyMeshClear.C.

void clearOut (  ) 

Clear all geometry and addressing unnecessary for CFD.

Reimplemented from primitiveMesh.

Reimplemented in fvMesh.

Definition at line 106 of file polyMeshClear.C.

Referenced by polyMesh::dbDir(), and Foam::polyMeshZipUpCells().

Here is the caller graph for this function:

void clearPrimitives (  ) 

Clear primitive data (points, faces and cells).

Definition at line 93 of file polyMeshClear.C.

void removeFiles ( const fileName instanceDir  )  const

Remove all files from mesh instance.

Definition at line 1121 of file polyMesh.C.

void removeFiles (  )  const

Remove all files from mesh instance().

Definition at line 1144 of file polyMesh.C.


Member Data Documentation

Foam::word defaultRegion = "region0" [static]

Return the default region name.

Definition at line 214 of file polyMesh.H.

Foam::word meshSubDir = "polyMesh" [static]

Return the mesh sub-directory name (usually "polyMesh").

Definition at line 217 of file polyMesh.H.

Referenced by Foam::writeMeshObject().


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd