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

globalMeshData Class Reference

Various mesh related information for a parallel run. Upon construction constructs all info by using parallel communication. More...

#include <OpenFOAM/globalMeshData.H>


Detailed Description

Various mesh related information for a parallel run. Upon construction constructs all info by using parallel communication.

Requires:

  • all processor patches to have correct ordering.
  • all processorPatches to have their transforms set ('makeTransforms')

The shared point addressing is quite interesting. It gives on each processor the vertices that cannot be set using a normal swap on processor patches. These are the vertices that are shared between more than 2 processors.

There is an issue with these shared vertices if they originate from cyclics (i.e. are now separated processor patches). They will all be mapped to the same global point (so even though the processor points are not on the same location) since topologically they are one and the same.

So if you ask for sharedPoints() you get only one of the coordinates of the topologically shared points.

All the hard work of these shared points is done by the globalPoints class.

Shared edges: similar to shared points gives on all processors the edges that are shared between more than two patches (i.e. the edges on which data cannot be synchronized by a straightforward edge data swap). Note that shared edges will use shared points but not all edges between shared points need to be shared edges (e.g. there might be an edge connecting two disconnected regions of shared points).

Currently an edge is considered shared if it uses two shared points and is used more than once. This is not correct on processor patches but it only slightly overestimates the number of shared edges. Doing full analysis of how many patches use the edge would be too complicated.

Shared edge calculation is demand driven so always make sure to have your first call to one of the access functions synchronous amongst all processors!

Source files

Definition at line 96 of file globalMeshData.H.

Inheritance diagram for globalMeshData:
Collaboration diagram for globalMeshData:

List of all members.

Classes

class  plusEqOp

Public Member Functions

 ClassName ("globalMeshData")
 Runtime type information.
 globalMeshData (const polyMesh &mesh)
 Construct from mesh, derive rest (does parallel communication!)
 globalMeshData (const IOobject &io, const polyMesh &mesh)
 Old behaviour: read constructor given IOobject and a polyMesh.
 ~globalMeshData ()
void  clearOut ()
 Remove all demand driven data.
const polyMesh &  mesh () const
 Return the mesh reference.
bool  parallel () const
 Does the mesh contain processor patches? (also valid when.
const boundBox &  bb () const
label  nTotalPoints () const
 Return total number of points in decomposed mesh.
label  nTotalFaces () const
 Return total number of faces in decomposed mesh.
label  nTotalCells () const
 Return total number of cells in decomposed mesh.
const labelList &  processorPatches () const
 Return list of processor patch labels.
const labelList &  processorPatchIndices () const
 Return list of indices into processorPatches_ for each patch.
const labelList &  processorPatchNeighbours () const
 Return processorPatchIndices of the neighbours.
label  nGlobalPoints () const
 Return number of globally shared points.
const labelList &  sharedPointLabels () const
 Return indices of local points that are globally shared.
const labelList &  sharedPointAddr () const
 Return addressing into the complete globally shared points.
const labelList &  sharedPointGlobalLabels () const
 Return shared point global labels. Tries to read.
pointField  sharedPoints () const
 Collect coordinates of shared points on all processors.
pointField  geometricSharedPoints () const
 Like sharedPoints but keeps cyclic points separate.
label  nGlobalEdges () const
 Return number of globally shared edges. Demand-driven.
const labelList &  sharedEdgeLabels () const
 Return indices of local edges that are globally shared.
const labelList &  sharedEdgeAddr () const
 Return addressing into the complete globally shared edge.
void  movePoints (const pointField &newPoints)
 Update for moving points.
void  updateMesh ()
 Change global mesh data given a topological change. Does a.
bool  write () const

Static Public Attributes

static const Foam::scalar  matchTol_ = 1E-8
 Geomtric tolerance (fraction of bounding box)

Friends

Ostream &  operator<< (Ostream &, const globalMeshData &)

Constructor & Destructor Documentation

globalMeshData ( const polyMesh &   mesh  )

Construct from mesh, derive rest (does parallel communication!)

Definition at line 439 of file globalMeshData.C.

References globalMeshData::updateMesh().

globalMeshData ( const IOobject &   io,
const polyMesh &   mesh  
)

Old behaviour: read constructor given IOobject and a polyMesh.

reference. Only use this for testing!

Definition at line 463 of file globalMeshData.C.

References dictionary::lookup(), and globalMeshData::sharedPointGlobalLabels().

Definition at line 500 of file globalMeshData.C.


Member Function Documentation

ClassName ( "globalMeshData"    )

Runtime type information.

void clearOut (  )

Remove all demand driven data.

Definition at line 506 of file globalMeshData.C.

References Foam::deleteDemandDrivenData().

const polyMesh& mesh (  ) const [inline]

Return the mesh reference.

Definition at line 261 of file globalMeshData.H.

bool parallel (  ) const [inline]

Does the mesh contain processor patches? (also valid when.

not running parallel)

Definition at line 268 of file globalMeshData.H.

References List< T >::size().

const boundBox& bb (  ) const [inline]

Definition at line 273 of file globalMeshData.H.

label nTotalPoints (  ) const [inline]

Return total number of points in decomposed mesh.

Definition at line 279 of file globalMeshData.H.

Referenced by inversePointDistanceDiffusivity::correct(), Foam::operator<<(), and meshRefinement::printMeshInfo().

label nTotalFaces (  ) const [inline]

Return total number of faces in decomposed mesh.

Definition at line 285 of file globalMeshData.H.

Referenced by Foam::operator<<(), and meshRefinement::printMeshInfo().

label nTotalCells (  ) const [inline]

Return total number of cells in decomposed mesh.

Definition at line 291 of file globalMeshData.H.

Referenced by inverseFaceDistanceDiffusivity::correct(), Foam::operator<<(), and meshRefinement::printMeshInfo().

const labelList& processorPatches (  ) const [inline]

Return list of processor patch labels.

(size of list = number of processor patches)

Definition at line 301 of file globalMeshData.H.

Referenced by Cloud< ParticleType >::move().

const labelList& processorPatchIndices (  ) const [inline]

Return list of indices into processorPatches_ for each patch.

Index = -1 for non-processor parches. (size of list = number of patches)

Definition at line 309 of file globalMeshData.H.

Referenced by Cloud< ParticleType >::move().

const labelList& processorPatchNeighbours (  ) const [inline]

Return processorPatchIndices of the neighbours.

processor patches. -1 if not running parallel.

Definition at line 316 of file globalMeshData.H.

Referenced by Cloud< ParticleType >::move().

label nGlobalPoints (  ) const [inline]
const labelList& sharedPointLabels (  ) const [inline]
const labelList& sharedPointAddr (  ) const [inline]

Return addressing into the complete globally shared points.

list Note: It is assumed that a (never constructed) complete list of globally shared points exists. The set of shared points on the current processor is a subset of all shared points. Shared point addressing gives the index in the list of all globally shared points for each of the locally shared points.

Definition at line 344 of file globalMeshData.H.

Referenced by polyMeshAdder::findSharedPoints(), syncTools::getMasterPoints(), Foam::operator<<(), globalPointPatch::sharedPointAddr(), syncTools::syncEdgeMap(), syncTools::syncPointList(), and syncTools::syncPointMap().

const Foam::labelList & sharedPointGlobalLabels (  ) const

Return shared point global labels. Tries to read.

'pointProcAddressing' and returns list or -1 if none available.

Definition at line 519 of file globalMeshData.C.

References Foam::endl(), forAll, IOobject::MUST_READ, and Foam::Pout.

Referenced by globalMeshData::globalMeshData().

Foam::pointField sharedPoints (  ) const

Collect coordinates of shared points on all processors.

(does parallel communication!) Note: not valid for cyclicParallel since shared cyclic points are merged into single global point. (use geometricSharedPoints instead)

Definition at line 565 of file globalMeshData.C.

References PstreamBase::blocking, Pstream::firstSlave(), forAll, Pstream::lastSlave(), Pstream::master(), Pstream::masterNo(), List< T >::size(), and Vector< Cmpt >::zero.

Foam::pointField geometricSharedPoints (  ) const

Like sharedPoints but keeps cyclic points separate.

(does geometric merging; uses matchTol_*bb as merging tolerance) Use sharedPoints() instead.

Definition at line 646 of file globalMeshData.C.

References Foam::combineReduce(), forAll, and Foam::mergePoints().

Foam::label nGlobalEdges (  ) const

Return number of globally shared edges. Demand-driven.

calculation so call needs to be synchronous among processors!

Definition at line 681 of file globalMeshData.C.

Referenced by syncTools::getMasterEdges(), and syncTools::syncEdgeList().

const Foam::labelList & sharedEdgeLabels (  ) const

Return indices of local edges that are globally shared.

Demand-driven calculation so call needs to be synchronous among processors!

Definition at line 691 of file globalMeshData.C.

Referenced by syncTools::getMasterEdges(), and syncTools::syncEdgeList().

const Foam::labelList & sharedEdgeAddr (  ) const

Return addressing into the complete globally shared edge.

list. The set of shared edges on the current processor is a subset of all shared edges. Shared edge addressing gives the index in the list of all globally shared edges for each of the locally shared edges. Demand-driven calculation so call needs to be synchronous among processors!

Definition at line 701 of file globalMeshData.C.

Referenced by syncTools::getMasterEdges(), and syncTools::syncEdgeList().

void movePoints ( const pointField &   newPoints  )

Update for moving points.

Definition at line 711 of file globalMeshData.C.


Friends And Related Function Documentation

Ostream& operator<< ( Ostream &   ,
const globalMeshData &    
) [friend]

Member Data Documentation

const Foam::scalar matchTol_ = 1E-8 [static]

Geomtric tolerance (fraction of bounding box)

Definition at line 235 of file globalMeshData.H.


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