Various mesh related information for a parallel run. Upon construction, constructs all info using parallel communication. More...
Classes | |
class | ListPlusEqOp |
Public Member Functions | |
ClassName ("globalMeshData") | |
Runtime type information. More... | |
globalMeshData (const polyMesh &mesh) | |
Construct from mesh, derive rest (does parallel communication!) More... | |
globalMeshData (const globalMeshData &)=delete | |
Disallow default bitwise copy construction. More... | |
~globalMeshData () | |
Destructor. More... | |
void | clearOut () |
Remove all demand driven data. More... | |
const polyMesh & | mesh () const |
Return the mesh reference. More... | |
bool | parallel () const |
Does the mesh contain processor patches? (also valid when. More... | |
label | nTotalPoints () const |
Return total number of points in decomposed mesh. Not. More... | |
label | nTotalFaces () const |
Return total number of faces in decomposed mesh. Not. More... | |
label | nTotalCells () const |
Return total number of cells in decomposed mesh. More... | |
const labelListList & | procNbrProcs () const |
Return the processor-processor connection table. More... | |
const lduSchedule & | patchSchedule () const |
Order in which the patches should be initialised/evaluated. More... | |
const labelList & | processorPatches () const |
Return list of processor patch labels. More... | |
const labelList & | processorPatchIndices () const |
Return list of indices into processorPatches_ for each patch. More... | |
const labelList & | processorPatchNeighbours () const |
Return processorPatchIndices of the neighbours. More... | |
label | nGlobalPoints () const |
Return number of globally shared points. More... | |
const labelList & | sharedPointLabels () const |
Return indices of local points that are globally shared. More... | |
const labelList & | sharedPointAddr () const |
Return addressing into the complete globally shared points. More... | |
const labelList & | sharedPointGlobalLabels () const |
Return shared point global labels. Tries to read. More... | |
pointField | sharedPoints () const |
Collect coordinates of shared points on all processors. More... | |
label | nGlobalEdges () const |
Return number of globally shared edges. Demand-driven. More... | |
const labelList & | sharedEdgeLabels () const |
Return indices of local edges that are globally shared. More... | |
const labelList & | sharedEdgeAddr () const |
Return addressing into the complete globally shared edge. More... | |
const indirectPrimitivePatch & | coupledPatch () const |
Return patch of all coupled faces. More... | |
const labelList & | coupledPatchMeshEdges () const |
Return map from coupledPatch edges to mesh edges. More... | |
const Map< label > & | coupledPatchMeshEdgeMap () const |
Return map from mesh edges to coupledPatch edges. More... | |
const globalIndexAndTransform & | globalTransforms () const |
Global transforms numbering. More... | |
const globalIndex & | globalPointNumbering () const |
Numbering of coupled points is according to coupledPatch. More... | |
const labelListList & | globalPointSlaves () const |
const labelListList & | globalPointTransformedSlaves () const |
const distributionMap & | globalPointSlavesMap () const |
template<class Type , class CombineOp , class TransformOp > | |
void | syncPointData (List< Type > &pointData, const CombineOp &cop, const TransformOp &top) const |
Helper to synchronise coupled patch point data. More... | |
const globalIndex & | globalEdgeNumbering () const |
const labelListList & | globalEdgeSlaves () const |
const labelListList & | globalEdgeTransformedSlaves () const |
const distributionMap & | globalEdgeSlavesMap () const |
const PackedBoolList & | globalEdgeOrientation () const |
Is my edge same orientation as master edge. More... | |
const labelListList & | globalCoPointSlaves () const |
const distributionMap & | globalCoPointSlavesMap () const |
const globalIndex & | globalBoundaryFaceNumbering () const |
Numbering of boundary faces is face-mesh.nInternalFaces() More... | |
const labelListList & | globalPointBoundaryFaces () const |
const labelListList & | globalPointTransformedBoundaryFaces () const |
const distributionMap & | globalPointBoundaryFacesMap () const |
const labelList & | boundaryCells () const |
From boundary cell to mesh cell. More... | |
const globalIndex & | globalBoundaryCellNumbering () const |
Numbering of boundary cells is according to boundaryCells() More... | |
const labelListList & | globalPointBoundaryCells () const |
const labelListList & | globalPointTransformedBoundaryCells () const |
const distributionMap & | globalPointBoundaryCellsMap () const |
autoPtr< globalIndex > | mergePoints (labelList &pointToGlobal, labelList &uniquePoints) const |
Helper for merging (collocated!) mesh point data. More... | |
autoPtr< globalIndex > | mergePoints (const labelList &meshPoints, const Map< label > &meshPointMap, labelList &pointToGlobal, labelList &uniqueMeshPoints) const |
Helper for merging (collocated!) patch point data. More... | |
void | movePoints (const pointField &newPoints) |
Update for moving points. More... | |
void | topoChange () |
Change global mesh data given a topological change. Does a. More... | |
void | operator= (const globalMeshData &)=delete |
Disallow default bitwise assignment. More... | |
Static Public Member Functions | |
template<class Type , class CombineOp , class TransformOp > | |
static void | syncData (List< Type > &pointData, const labelListList &slaves, const labelListList &transformedSlaves, const distributionMap &slavesMap, const globalIndexAndTransform &, const CombineOp &cop, const TransformOp &top) |
Helper: synchronise data with transforms. More... | |
template<class Type , class CombineOp > | |
static void | syncData (List< Type > &pointData, const labelListList &slaves, const labelListList &transformedSlaves, const distributionMap &slavesMap, const CombineOp &cop) |
Helper: synchronise data without transforms. More... | |
Static Public Attributes | |
static const Foam::scalar | matchTol_ = 1e-8 |
Geometric tolerance (fraction of bounding box) More... | |
Various mesh related information for a parallel run. Upon construction, constructs all info using parallel communication.
Requires:
The shared point and edge addressing calculates addressing for points and edges on coupled patches. In the 'old' way a distinction was made between points/edges that are only on two processors and those that are on multiple processors. The problem is that those on multiple processors do not allow any transformations and require a global reduction on the master processor.
The alternative is to have an exchange schedule (through a 'distributionMap') which sends all point/edge data (no distinction is made between those on two and those on more than two coupled patches) to the local 'master'. This master then does any calculation and sends the result back to the 'slave' points/edges. This only needs to be done on points on coupled faces. Any transformation is done using a predetermined set of transformations - since transformations have to be space filling only a certain number of transformation is supported.
The exchange needs
Note:
Definition at line 106 of file globalMeshData.H.
globalMeshData | ( | const polyMesh & | mesh | ) |
Construct from mesh, derive rest (does parallel communication!)
Definition at line 1687 of file globalMeshData.C.
References globalMeshData::topoChange().
|
delete |
Disallow default bitwise copy construction.
~globalMeshData | ( | ) |
Destructor.
Definition at line 1711 of file globalMeshData.C.
ClassName | ( | "globalMeshData" | ) |
Runtime type information.
void clearOut | ( | ) |
Remove all demand driven data.
Definition at line 1717 of file globalMeshData.C.
|
inline |
Return the mesh reference.
Definition at line 366 of file globalMeshData.H.
|
inline |
Does the mesh contain processor patches? (also valid when.
not running parallel)
Definition at line 373 of file globalMeshData.H.
|
inline |
Return total number of points in decomposed mesh. Not.
compensated for duplicate points!
Definition at line 380 of file globalMeshData.H.
Referenced by mappedExtrudedPatchBase::patchLocalPoints().
|
inline |
Return total number of faces in decomposed mesh. Not.
compensated for duplicate faces!
Definition at line 387 of file globalMeshData.H.
|
inline |
Return total number of cells in decomposed mesh.
Definition at line 393 of file globalMeshData.H.
Referenced by structuredDecomp::decompose(), decompositionMethod::decompose(), mappedExtrudedPatchBase::patchFaceAreas(), mappedExtrudedPatchBase::patchLocalPoints(), meshRefinement::printMeshInfo(), structuredRenumber::renumber(), Foam::fvc::smooth(), distributor::update(), and cellsToCellsStabilisation::update().
|
inline |
Return the processor-processor connection table.
Definition at line 402 of file globalMeshData.H.
References processorTopology::procNbrProcs().
|
inline |
Order in which the patches should be initialised/evaluated.
corresponding to the schedule
Definition at line 409 of file globalMeshData.H.
|
inline |
Return list of processor patch labels.
(size of list = number of processor patches)
Definition at line 416 of file globalMeshData.H.
Referenced by FaceCellWave< Type, TrackingData >::handleProcPatches().
|
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 424 of file globalMeshData.H.
|
inline |
Return processorPatchIndices of the neighbours.
processor patches. -1 if not running parallel.
Definition at line 431 of file globalMeshData.H.
Foam::label nGlobalPoints | ( | ) | const |
Return number of globally shared points.
Definition at line 1908 of file globalMeshData.C.
Referenced by syncTools::syncPointMap().
const Foam::labelList & sharedPointLabels | ( | ) | const |
Return indices of local points that are globally shared.
Definition at line 1918 of file globalMeshData.C.
Referenced by syncTools::syncEdgeMap(), and syncTools::syncPointMap().
const Foam::labelList & sharedPointAddr | ( | ) | const |
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 1928 of file globalMeshData.C.
Referenced by syncTools::syncEdgeMap(), 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 1769 of file globalMeshData.C.
References Foam::endl(), forAll, typeIOobject< Type >::headerOk(), IOobject::MUST_READ, pointLabels(), and Foam::Pout.
Foam::pointField sharedPoints | ( | ) | const |
Collect coordinates of shared points on all processors.
Does parallel communication. Not valid for points on cyclics since these combine into a single shared point but span multiple locations.
Definition at line 1819 of file globalMeshData.C.
References UPstream::blocking, UPstream::firstSlave(), forAll, UPstream::lastSlave(), UPstream::master(), UPstream::masterNo(), pointLabels(), List< T >::size(), and Foam::Zero.
Foam::label nGlobalEdges | ( | ) | const |
Return number of globally shared edges. Demand-driven.
calculation so call needs to be synchronous among processors!
Definition at line 1938 of file globalMeshData.C.
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 1948 of file globalMeshData.C.
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 1958 of file globalMeshData.C.
const Foam::indirectPrimitivePatch & coupledPatch | ( | ) | const |
Return patch of all coupled faces.
Definition at line 1968 of file globalMeshData.C.
References bMesh, polyPatch::coupled(), Foam::endl(), forAll, patchi, Foam::Pout, and polyPatch::start().
Referenced by createShellMesh::calcPointRegions(), syncTools::getMasterPoints(), globalIndexAndTransform::globalIndexAndTransform(), PatchEdgeFaceWave< PrimitivePatchType, Type, TrackingData >::PatchEdgeFaceWave(), PatchTools::pointNormals(), motionSmootherAlgo::setDisplacement(), syncTools::syncEdgeList(), syncTools::syncPointList(), and pointConstraints::syncUntransformedData().
const Foam::labelList & coupledPatchMeshEdges | ( | ) | const |
Return map from coupledPatch edges to mesh edges.
Definition at line 2029 of file globalMeshData.C.
Referenced by syncTools::getMasterEdges(), and syncTools::syncEdgeList().
const Foam::Map< Foam::label > & coupledPatchMeshEdgeMap | ( | ) | const |
Return map from mesh edges to coupledPatch edges.
Definition at line 2049 of file globalMeshData.C.
References forAll, HashTable< T, Key, Hash >::insert(), and Foam::constant::atomic::me.
Referenced by syncTools::syncEdgeList().
const Foam::globalIndexAndTransform & globalTransforms | ( | ) | const |
Global transforms numbering.
Definition at line 2082 of file globalMeshData.C.
Referenced by PatchTools::edgeNormals(), PatchTools::pointNormals(), syncTools::syncEdgeList(), and syncTools::syncPointList().
|
static |
Helper: synchronise data with transforms.
Definition at line 33 of file globalMeshDataTemplates.C.
References distributionMap::distribute(), forAll, distributionMap::reverseDistribute(), List< T >::size(), and transforms.
Referenced by PatchTools::edgeNormals(), syncTools::syncEdgeList(), and syncTools::syncPointList().
|
static |
Helper: synchronise data without transforms.
Definition at line 106 of file globalMeshDataTemplates.C.
References distributionMap::distribute(), forAll, distributionMap::reverseDistribute(), and List< T >::size().
const Foam::globalIndex & globalPointNumbering | ( | ) | const |
Numbering of coupled points is according to coupledPatch.
Definition at line 2068 of file globalMeshData.C.
References nPoints.
const Foam::labelListList & globalPointSlaves | ( | ) | const |
Definition at line 2092 of file globalMeshData.C.
Referenced by syncTools::getMasterPoints(), PatchTools::pointNormals(), and syncTools::syncPointList().
const Foam::labelListList & globalPointTransformedSlaves | ( | ) | const |
Definition at line 2102 of file globalMeshData.C.
Referenced by syncTools::getMasterPoints(), PatchTools::pointNormals(), and syncTools::syncPointList().
const Foam::distributionMap & globalPointSlavesMap | ( | ) | const |
Definition at line 2113 of file globalMeshData.C.
Referenced by PatchTools::pointNormals(), and syncTools::syncPointList().
void syncPointData | ( | List< Type > & | pointData, |
const CombineOp & | cop, | ||
const TransformOp & | top | ||
) | const |
Helper to synchronise coupled patch point data.
Definition at line 171 of file globalMeshDataTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and PrimitivePatch< FaceList, PointField >::meshPoints().
Referenced by Dual< Type >::Dual(), and syncTools::syncPointList().
const Foam::globalIndex & globalEdgeNumbering | ( | ) | const |
Definition at line 2123 of file globalMeshData.C.
const Foam::labelListList & globalEdgeSlaves | ( | ) | const |
Definition at line 2136 of file globalMeshData.C.
Referenced by PatchTools::edgeNormals(), syncTools::getMasterEdges(), and syncTools::syncEdgeList().
const Foam::labelListList & globalEdgeTransformedSlaves | ( | ) | const |
Definition at line 2146 of file globalMeshData.C.
Referenced by PatchTools::edgeNormals(), syncTools::getMasterEdges(), and syncTools::syncEdgeList().
const Foam::distributionMap & globalEdgeSlavesMap | ( | ) | const |
Definition at line 2167 of file globalMeshData.C.
Referenced by PatchTools::edgeNormals(), and syncTools::syncEdgeList().
const Foam::PackedBoolList & globalEdgeOrientation | ( | ) | const |
Is my edge same orientation as master edge.
Definition at line 2157 of file globalMeshData.C.
const Foam::labelListList & globalCoPointSlaves | ( | ) | const |
Definition at line 2275 of file globalMeshData.C.
Referenced by globalIndexAndTransform::globalIndexAndTransform(), and pointConstraints::syncUntransformedData().
const Foam::distributionMap & globalCoPointSlavesMap | ( | ) | const |
Definition at line 2286 of file globalMeshData.C.
Referenced by globalIndexAndTransform::globalIndexAndTransform(), and pointConstraints::syncUntransformedData().
const Foam::globalIndex & globalBoundaryFaceNumbering | ( | ) | const |
Numbering of boundary faces is face-mesh.nInternalFaces()
Definition at line 2177 of file globalMeshData.C.
const Foam::labelListList & globalPointBoundaryFaces | ( | ) | const |
Definition at line 2188 of file globalMeshData.C.
const Foam::labelListList & globalPointTransformedBoundaryFaces | ( | ) | const |
Definition at line 2200 of file globalMeshData.C.
const Foam::distributionMap & globalPointBoundaryFacesMap | ( | ) | const |
Definition at line 2210 of file globalMeshData.C.
const Foam::labelList & boundaryCells | ( | ) | const |
From boundary cell to mesh cell.
Definition at line 2221 of file globalMeshData.C.
const Foam::globalIndex & globalBoundaryCellNumbering | ( | ) | const |
Numbering of boundary cells is according to boundaryCells()
Definition at line 2231 of file globalMeshData.C.
const Foam::labelListList & globalPointBoundaryCells | ( | ) | const |
Definition at line 2242 of file globalMeshData.C.
const Foam::labelListList & globalPointTransformedBoundaryCells | ( | ) | const |
Definition at line 2254 of file globalMeshData.C.
const Foam::distributionMap & globalPointBoundaryCellsMap | ( | ) | const |
Definition at line 2264 of file globalMeshData.C.
Foam::autoPtr< Foam::globalIndex > mergePoints | ( | labelList & | pointToGlobal, |
labelList & | uniquePoints | ||
) | const |
Helper for merging (collocated!) mesh point data.
Determines:
Definition at line 2296 of file globalMeshData.C.
References distributionMapBase::constructSize(), forAll, PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::nPoints(), distributionMap::reverseDistribute(), List< T >::setSize(), List< T >::size(), and globalIndex::toGlobal().
Referenced by PatchTools::gatherAndMerge(), and FacePostProcessing< CloudType >::write().
Foam::autoPtr< Foam::globalIndex > mergePoints | ( | const labelList & | meshPoints, |
const Map< label > & | meshPointMap, | ||
labelList & | pointToGlobal, | ||
labelList & | uniqueMeshPoints | ||
) | const |
Helper for merging (collocated!) patch point data.
Takes maps from: local points to/from mesh. Determines
Definition at line 2430 of file globalMeshData.C.
References distributionMapBase::constructSize(), distributionMap::distribute(), HashTableCore::end(), HashTable< T, Key, Hash >::find(), forAll, Foam::labelMax, PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::nPoints(), distributionMap::reverseDistribute(), List< T >::setSize(), List< T >::size(), and globalIndex::toGlobal().
void movePoints | ( | const pointField & | newPoints | ) |
Update for moving points.
Definition at line 2633 of file globalMeshData.C.
void topoChange | ( | ) |
Change global mesh data given a topological change. Does a.
full parallel analysis to determine shared points and boundaries.
Definition at line 2642 of file globalMeshData.C.
References UPstream::allocateCommunicator(), Foam::endl(), UPstream::freeCommunicator(), Foam::identityMap(), UPstream::msgType(), UPstream::nProcs(), Foam::Pout, Foam::returnReduce(), and UPstream::worldComm.
Referenced by globalMeshData::globalMeshData().
|
delete |
Disallow default bitwise assignment.
|
static |
Geometric tolerance (fraction of bounding box)
Definition at line 342 of file globalMeshData.H.