FreeFOAM The Cross-Platform CFD Toolkit
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 polyMeshmesh () const
 Return the mesh reference.
bool parallel () const
 Does the mesh contain processor patches? (also valid when.
const boundBoxbb () 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 labelListprocessorPatches () const
 Return list of processor patch labels.
const labelListprocessorPatchIndices () const
 Return list of indices into processorPatches_ for each patch.
const labelListprocessorPatchNeighbours () const
 Return processorPatchIndices of the neighbours.
label nGlobalPoints () const
 Return number of globally shared points.
const labelListsharedPointLabels () const
 Return indices of local points that are globally shared.
const labelListsharedPointAddr () const
 Return addressing into the complete globally shared points.
const labelListsharedPointGlobalLabels () 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 labelListsharedEdgeLabels () const
 Return indices of local edges that are globally shared.
const labelListsharedEdgeAddr () 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
- Public Member Functions inherited from ProcessorTopology< Patch, ProcPatch >
 ProcessorTopology (const PtrList< Patch > &patches)
 Construct from boundaryMesh.
const labelListprocPatchMap () const
 from neighbour processor to index in boundaryMesh. Local information
const lduSchedulepatchSchedule () const
 Order in which the patches should be initialised/evaluated.
- Public Member Functions inherited from List< labelList >
label size () const
 Return the number of elements in the UList.
 List ()
 Null constructor.
 List (const label)
 Construct with given size.
 List (const label, const labelList &)
 Construct with given size and value for all elements.
 List (const List< labelList > &)
 Copy constructor.
 List (const Xfer< List< labelList > > &)
 Construct by transferring the parameter contents.
 List (List< labelList > &, bool reUse)
 Construct as copy or re-use as specified.
 List (const UList< labelList > &, const unallocLabelList &mapAddressing)
 Construct as subset.
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators.
 List (const FixedList< labelList, Size > &)
 Construct as copy of FixedList<T, Size>
 List (const PtrList< labelList > &)
 Construct as copy of PtrList<T>
 List (const SLList< labelList > &)
 Construct as copy of SLList<T>
 List (const IndirectList< labelList > &)
 Construct as copy of IndirectList<T>
 List (const UIndirectList< labelList > &)
 Construct as copy of UIndirectList<T>
 List (const BiIndirectList< labelList > &)
 Construct as copy of BiIndirectList<T>
 List (Istream &)
 Construct from Istream.
autoPtr< List< labelList > > clone () const
 Clone.
 ~List ()
void resize (const label)
 Reset size of List.
void resize (const label, const labelList &)
 Reset size of List and value for new elements.
void setSize (const label)
 Reset size of List.
void setSize (const label, const labelList &)
 Reset size of List and value for new elements.
void clear ()
 Clear the list, i.e. set size to zero.
void append (const UList< labelList > &)
 Append a List at the end of this list.
void append (const UIndirectList< labelList > &)
 Append a UIndirectList at the end of this list.
void transfer (List< labelList > &)
 Transfer the contents of the argument List into this list.
void transfer (DynamicList< labelList, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list.
void transfer (SortableList< labelList > &)
 Transfer the contents of the argument List into this list.
Xfer< List< labelList > > xfer ()
 Transfer contents to the Xfer container.
labelListnewElmt (const label)
 Return subscript-checked element of UList.
void operator= (const UList< labelList > &)
 Assignment from UList operator. Takes linear time.
void operator= (const List< labelList > &)
 Assignment operator. Takes linear time.
void operator= (const SLList< labelList > &)
 Assignment from SLList operator. Takes linear time.
void operator= (const IndirectList< labelList > &)
 Assignment from IndirectList operator. Takes linear time.
void operator= (const UIndirectList< labelList > &)
 Assignment from UIndirectList operator. Takes linear time.
void operator= (const BiIndirectList< labelList > &)
 Assignment from BiIndirectList operator. Takes linear time.
void operator= (const labelList &)
 Assignment of all entries to the given value.
- Public Member Functions inherited from UList< labelList >
 UList ()
 Null constructor.
 UList (labelList *__restrict__ v, label size)
 Construct from components.
label fcIndex (const label i) const
 Return the forward circular index, i.e. the next index.
label rcIndex (const label i) const
 Return the reverse circular index, i.e. the previous index.
label byteSize () const
 Return the binary size in number of characters of the UList.
const labelListcdata () const
 Return a const pointer to the first data element,.
labelListdata ()
 Return a pointer to the first data element,.
void checkStart (const label start) const
 Check start is within valid range (0 ... size-1).
void checkSize (const label size) const
 Check size is within valid range (0 ... size).
void checkIndex (const label i) const
 Check index i is within valid range (0 ... size-1).
void writeEntry (Ostream &) const
 Write the UList as a dictionary entry.
void writeEntry (const word &keyword, Ostream &) const
 Write the UList as a dictionary entry with keyword.
void assign (const UList< labelList > &)
 Assign elements to those from UList.
labelListoperator[] (const label)
 Return element of UList.
const labelListoperator[] (const label) const
 Return element of constant UList.
 operator const Foam::List< labelList > & () const
 Allow cast to a const List<T>&.
iterator begin ()
 Return an iterator to begin traversing the UList.
const_iterator begin () const
 Return const_iterator to begin traversing the constant UList.
iterator end ()
 Return an iterator to end traversing the UList.
const_iterator end () const
 Return const_iterator to end traversing the constant UList.
const_iterator cbegin () const
 Return const_iterator to begin traversing the constant UList.
const_iterator cend () const
 Return const_iterator to end traversing the constant UList.
reverse_iterator rbegin ()
 Return reverse_iterator to begin reverse traversing the UList.
const_reverse_iterator rbegin () const
 Return const_reverse_iterator to begin reverse traversing the UList.
reverse_iterator rend ()
 Return reverse_iterator to end reverse traversing the UList.
const_reverse_iterator rend () const
 Return const_reverse_iterator to end reverse traversing the UList.
const_reverse_iterator crbegin () const
 Return const_reverse_iterator to begin reverse traversing the UList.
const_reverse_iterator crend () const
 Return const_reverse_iterator to end reverse traversing the UList.
label max_size () const
 Return size of the largest possible UList.
bool empty () const
 Return true if the UList is empty (ie, size() is zero).
void swap (UList< labelList > &)
 Swap two ULists of the same type in constant time.
bool operator== (const UList< labelList > &) const
 Equality operation on ULists of the same type.
bool operator!= (const UList< labelList > &) const
 The opposite of the equality operation. Takes linear time.
bool operator< (const UList< labelList > &) const
 Compare two ULists lexicographically. Takes linear time.
bool operator> (const UList< labelList > &) const
 Compare two ULists lexicographically. Takes linear time.
bool operator<= (const UList< labelList > &) const
 Return true if !(a > b). Takes linear time.
bool operator>= (const UList< labelList > &) const
 Return true if !(a < b). Takes linear time.

Static Public Attributes

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

Friends

Ostreamoperator<< (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< scalar >::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: