FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Mesh consisting of general polyhedral cells. More...

#include <OpenFOAM/polyMesh.H>


Detailed Description

Mesh consisting of general polyhedral cells.

Source files

Definition at line 70 of file polyMesh.H.

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 fileName &  dbDir () const
 Override the objectRegistry dbDir for a single-region case.
fileName  meshDir () const
 Return the local mesh directory (dbDir()/meshSubDir)
const fileName &  pointsInstance () const
 Return the current instance directory for points.
const fileName &  facesInstance () const
 Return the current instance directory for faces.
void  setInstance (const fileName &)
 Set the instance for mesh files.
virtual const pointField &  points () const
 Return raw points.
virtual const faceList &  faces () const
 Return raw faces.
virtual const labelList &  faceOwner () const
 Return face owner.
virtual const labelList &  faceNeighbour () const
 Return face neighbour.
virtual const pointField &  oldPoints () const
 Return old points for mesh motion.
const polyBoundaryMesh &  boundaryMesh () const
 Return boundary mesh.
const boundBox &  bounds () 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 pointZoneMesh &  pointZones () const
 Return point zone mesh.
const faceZoneMesh &  faceZones () const
 Return face zone mesh.
const cellZoneMesh &  cellZones () const
 Return cell zone mesh.
const globalMeshData &  globalData () const
 Return parallel info.
const objectRegistry &  thisDb () 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< scalarField >  movePoints (const pointField &)
 Move points, returns volumes swept by faces in motion.
void  resetMotion () const
 Reset motion.
pointZoneMesh &  pointZones ()
 Return non-const access to the pointZones.
faceZoneMesh &  faceZones ()
 Return non-const access to the faceZones.
cellZoneMesh &  cellZones ()
 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")

Member Typedef Documentation

typedef polyMesh Mesh

Reimplemented in fvMesh.

Definition at line 201 of file polyMesh.H.

Reimplemented in fvMesh.

Definition at line 202 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 84 of file polyMesh.H.


Constructor & Destructor Documentation

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 314 of file polyMesh.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, Foam::max(), Foam::min(), and List< T >::size().

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 471 of file polyMesh.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, Foam::max(), Foam::min(), and List< T >::size().

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  
)
~polyMesh (  ) [virtual]

Definition at line 775 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 784 of file polyMesh.C.

References objectRegistry::dbDir().

Foam::fileName meshDir (  ) const

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

Definition at line 797 of file polyMesh.C.

Referenced by polyMesh::polyMesh().

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 803 of file polyMesh.C.

const Foam::fileName & facesInstance (  ) const

Return the current instance directory for faces.

Definition at line 809 of file polyMesh.C.

Referenced by attachPolyTopoChanger::attach(), and manualDecomp::decompose().

void setInstance ( const fileName &   inst  )
const Foam::pointField & oldPoints (  ) const [virtual]
const polyBoundaryMesh& boundaryMesh (  ) const [inline]

Return boundary mesh.

Definition at line 304 of file polyMesh.H.

Referenced by polyMeshAdder::add(), fvMeshAdder::add(), autoLayerDriver::addLayers(), polyTopoChange::addMesh(), meshRefinement::addPatch(), cellToFaceStencil::allCoupledFacesPatch(), cellToCellStencil::allCoupledFacesPatch(), attachPolyTopoChanger::attach(), scotchDecomp::calcCSR(), extendedCellToFaceStencil::calcDistributeMap(), polyDualMesh::calcFeatures(), parMetisDecomp::calcMetisDistributedCSR(), cellPointWeightWallModified::cellPointWeightWallModified(), polyTopoChange::changeMesh(), polyMeshGeometry::checkFaceDotProduct(), polyMeshGeometry::checkFaceSkewness(), polyMeshGeometry::checkFaceTwist(), polyMeshGeometry::checkFaceWeights(), faceZone::checkParallelSync(), polyMeshGeometry::checkVolRatio(), inversePointDistanceDiffusivity::correct(), inverseFaceDistanceDiffusivity::correct(), wallDistData< TransferType >::correct(), cellDistFuncs::correctBoundaryFaceCells(), cellDistFuncs::correctBoundaryPointCells(), directions::directions(), fvMeshDistribute::distribute(), autoLayerDriver::doLayers(), extendedCellToFaceStencil::extendedCellToFaceStencil(), extendedFaceToCellStencil::extendedFaceToCellStencil(), Cloud< BasicReactingParcel< ThermoType > >::facePatch(), patchProbes::findElements(), syncTools::getMasterEdges(), syncTools::getMasterFaces(), syncTools::getMasterPoints(), cellDistFuncs::getPatchIDs(), FreeStream< CloudType >::inflow(), interpolationCellPatchConstrained< Type >::interpolate(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::K(), turbulentTemperatureCoupledBaffleFvPatchScalarField::K(), Particle< ParticleType >::lambda(), LocalInteraction< CloudType >::LocalInteraction(), localPointRegion::localPointRegion(), polyTopoChange::makeMesh(), meshRefinement::makePatch(), cellDistFuncs::maxPatchSize(), polyMeshAdder::mergePoints(), meshTriangulation::meshTriangulation(), solidParticle::move(), KinematicParcel< ParcelType >::move(), DsmcParcel< ParcelType >::move(), parcel::move(), Cloud< ParticleType >::move(), MRFZone::MRFZone(), Cloud< BasicReactingParcel< ThermoType > >::patchFace(), boundaryMesh::patchify(), sampledPatch::patchIndex(), Foam::polyMeshZipUpCells(), polyTopoChange::polyTopoChange(), forces::read(), boundaryMesh::read(), ensightParts::recalculate(), autoSnapDriver::repatchToSurface(), sampledCuttingPlane::sampledCuttingPlane(), sampledIsoSurface::sampledIsoSurface(), directMappedPatchBase::sampleMesh(), directMappedPatchBase::samplePolyPatch(), perfectInterface::setRefinement(), meshCutAndRemove::setRefinement(), fvMatrix< Type >::setValues(), spray::spray(), cellDistFuncs::sumPatchSize(), faceSet::sync(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncEdgeMap(), syncTools::syncFaceList(), syncTools::syncPointList(), syncTools::syncPointMap(), Particle< ParticleType >::trackToFace(), ExactParticle< ParticleType >::trackToFace(), sampledPatch::update(), surfaceDisplacementPointPatchVectorField::updateCoeffs(), directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs(), directMappedFixedValueFvPatchField< Type >::updateCoeffs(), slidingInterface::updateMesh(), perfectInterface::updateMesh(), attachDetach::updateMesh(), cellToFaceStencil::validBoundaryFaces(), cellToCellStencil::validBoundaryFaces(), wallLayerCells::wallLayerCells(), and dsmcFields::write().

const boundBox& bounds (  ) const [inline]

Return mesh bounding box.

Definition at line 310 of file polyMesh.H.

Referenced by Foam::meshTools::constrainToMeshCentre(), refinementParameters::findCells(), and Kmesh::Kmesh().

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 815 of file polyMesh.C.

Referenced by Foam::meshTools::constrainToMeshCentre().

Foam::label nGeometricD (  ) const

Return the number of valid geometric dimensions in the mesh.

Definition at line 826 of file polyMesh.C.

References Foam::cmptSum().

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 832 of file polyMesh.C.

Referenced by KinematicParcel< ParcelType >::calcVelocity(), InjectionModel< CloudType >::inject(), and DsmcParcel< ParcelType >::move().

Foam::label nSolutionD (  ) const

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

Definition at line 843 of file polyMesh.C.

References Foam::cmptSum().

Referenced by fvDOM::fvDOM().

const objectRegistry& thisDb (  ) const [inline]

Return the object registry.

Reimplemented in fvMesh.

Definition at line 355 of file polyMesh.H.

Referenced by polyMesh::updateMesh().

bool moving ( const bool   m  ) [inline]

Set the mesh to be moving.

Definition at line 369 of file polyMesh.H.

bool changing ( const bool   c  ) [inline]

Set the mesh to be changing.

Definition at line 384 of file polyMesh.H.

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

Reset motion.

Definition at line 1108 of file polyMesh.C.

References Foam::deleteDemandDrivenData().

Referenced by polyMeshAdder::add().

pointZoneMesh& pointZones (  ) [inline]

Return non-const access to the pointZones.

Definition at line 401 of file polyMesh.H.

faceZoneMesh& faceZones (  ) [inline]

Return non-const access to the faceZones.

Definition at line 407 of file polyMesh.H.

cellZoneMesh& cellZones (  ) [inline]

Return non-const access to the cellZones.

Definition at line 413 of file polyMesh.H.

void addPatches ( const List< polyPatch * > &   p,
const bool   validBoundary = true  
)
void addZones ( const List< pointZone * > &   pz,
const List< faceZone * > &   fz,
const List< cellZone * > &   cz  
)

Add mesh zones.

Definition at line 898 of file polyMesh.C.

References Foam::abort(), IOobject::AUTO_WRITE, Foam::FatalError, FatalErrorIn, forAll, and List< T >::size().

Referenced by polyTopoChange::makeMesh().

void removeBoundary (  )
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 652 of file polyMesh.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, Foam::max(), Foam::min(), Foam::name(), nPoints, points, Foam::returnReduce(), List< T >::size(), and timeName.

Referenced by polyMeshAdder::add(), polyTopoChange::changeMesh(), and Foam::polyMeshZipUpCells().

void clearGeom (  )

Clear geometry.

Reimplemented from primitiveMesh.

Definition at line 54 of file polyMeshClear.C.

References primitiveMesh::clearGeom(), MeshObject< polyMesh, pointMesh >::Delete(), Foam::endl(), forAll, and Foam::Info.

void clearAddressing (  )
void clearOut (  )

Clear all geometry and addressing unnecessary for CFD.

Reimplemented from primitiveMesh.

Reimplemented in fvMesh.

Definition at line 114 of file polyMeshClear.C.

Referenced by fvMesh::clearOut(), Foam::polyMeshZipUpCells(), and polyMesh::removeBoundary().

void clearPrimitives (  )

Clear primitive data (points, faces and cells)

Definition at line 101 of file polyMeshClear.C.

void removeFiles ( const fileName &   instanceDir  ) const

Remove all files from mesh instance.

Definition at line 1136 of file polyMesh.C.

References Foam::isDir(), fileName::path(), Foam::rm(), and Foam::rmDir().

Referenced by meshReader::writeMesh().

void removeFiles (  ) const

Remove all files from mesh instance()

Definition at line 1159 of file polyMesh.C.


Member Data Documentation

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

Return the default region name.

Definition at line 209 of file polyMesh.H.

Referenced by probes::checkFieldTypes(), regIOobject::checkIn(), meshReader::mesh(), and sampledSets::sampledSets().

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

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

Definition at line 212 of file polyMesh.H.

Referenced by polyMesh::polyMesh().


The documentation for this class was generated from the following files: