Various mesh related information for a parallel run. Upon construction, constructs all info using parallel communication. More...
Classes | |
struct | ListPlusEqOp |
Deprecated(2020-09) use ListOps::appendEqOp. More... | |
Public Member Functions | |
ClassName ("globalMeshData") | |
Runtime type information. More... | |
globalMeshData (const polyMesh &mesh) | |
Construct from mesh, derive rest (does parallel communication!) More... | |
~globalMeshData () | |
Destructor. More... | |
void | clearOut () |
Remove all demand driven data. More... | |
const polyMesh & | mesh () const noexcept |
Return the mesh reference. More... | |
bool | parallel () const |
Does the mesh contain processor patches? (also valid when. More... | |
label | nTotalPoints () const noexcept |
Return total number of points in decomposed mesh. Not. More... | |
label | nTotalFaces () const noexcept |
Return total number of faces in decomposed mesh. Not. More... | |
label | nTotalCells () const noexcept |
Return total number of cells in decomposed mesh. More... | |
const labelList & | processorPatches () const noexcept |
Return list of processor patch labels. More... | |
const labelList & | processorPatchIndices () const noexcept |
Return list of indices into processorPatches_ for each patch. More... | |
const labelList & | processorPatchNeighbours () const noexcept |
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... | |
pointField | geometricSharedPoints () const |
Like sharedPoints but keeps cyclic points separate. 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 mapDistribute & | 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 mapDistribute & | globalEdgeSlavesMap () const |
const bitSet & | globalEdgeOrientation () const |
Is my edge same orientation as master edge. More... | |
const labelListList & | globalCoPointSlaves () const |
const mapDistribute & | globalCoPointSlavesMap () const |
const globalIndex & | globalBoundaryFaceNumbering () const |
Numbering of boundary faces is face-mesh.nInternalFaces() More... | |
const labelListList & | globalPointBoundaryFaces () const |
const labelListList & | globalPointTransformedBoundaryFaces () const |
const mapDistribute & | 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 mapDistribute & | 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 | updateMesh () |
Change global mesh data given a topological change. Does a. More... | |
![]() | |
ProcessorTopology (const Container &patches, const label comm) | |
Construct from boundaryMesh. More... | |
const labelList & | procPatchMap () const |
From neighbour processor to index in boundaryMesh. Local information. More... | |
const lduSchedule & | patchSchedule () const |
Order in which the patches should be initialised/evaluated. More... | |
![]() | |
constexpr | List () noexcept |
Default construct. More... | |
List (const label len) | |
Construct with given size. More... | |
List (const label len, const T &val) | |
Construct with given size and value for all elements. More... | |
List (const label len, const Foam::zero) | |
Construct with given size initializing all elements to zero. More... | |
List (const Foam::one, const T &val) | |
Construct with length=1, copying the value as the only content. More... | |
List (const Foam::one, T &&val) | |
Construct with length=1, moving the value as the only content. More... | |
List (const Foam::one, const Foam::zero) | |
Construct with length=1, initializing content to zero. More... | |
List (const List< T > &a) | |
Copy construct from list. More... | |
List (const UList< T > &a) | |
Copy construct contents from list. More... | |
List (List< T > &a, bool reuse) | |
Construct as copy or re-use as specified. More... | |
List (const UList< T > &list, const labelUList &indices) | |
Copy construct subset of list. More... | |
template<unsigned N> | |
List (const UList< T > &list, const FixedList< label, N > &indices) | |
Copy construct subset of list. More... | |
template<unsigned N> | |
List (const FixedList< T, N > &list) | |
Construct as copy of FixedList<T, N> More... | |
List (const PtrList< T > &list) | |
Construct as copy of PtrList<T> More... | |
List (const SLList< T > &list) | |
Construct as copy of SLList<T> More... | |
template<class Addr > | |
List (const IndirectListBase< T, Addr > &list) | |
Construct as copy of IndirectList contents. More... | |
List (std::initializer_list< T > list) | |
Construct from an initializer list. More... | |
List (List< T > &&list) | |
Move construct from List. More... | |
template<int SizeMin> | |
List (DynamicList< T, SizeMin > &&list) | |
Move construct from DynamicList. More... | |
List (SortableList< T > &&list) | |
Move construct from SortableList. More... | |
List (SLList< T > &&list) | |
Move construct from SLList. More... | |
List (Istream &is) | |
Construct from Istream. More... | |
autoPtr< List< T > > | clone () const |
Clone. More... | |
~List () | |
Destructor. More... | |
void | clear () |
Clear the list, i.e. set size to zero. More... | |
void | resize (const label len) |
Adjust allocated size of list. More... | |
void | resize (const label len, const T &val) |
Adjust allocated size of list and set val for new elements. More... | |
void | resize_nocopy (const label len) |
Adjust allocated size of list without necessarily. More... | |
void | setSize (const label n) |
Alias for resize() More... | |
void | setSize (const label n, const T &val) |
Alias for resize() More... | |
void | append (const T &val) |
Append an element at the end of the list. More... | |
void | append (T &&val) |
Move append an element at the end of the list. More... | |
void | append (const UList< T > &list) |
Append a List to the end of this list. More... | |
template<class Addr > | |
void | append (const IndirectListBase< T, Addr > &list) |
Append IndirectList contents at the end of this list. More... | |
label | appendUniq (const T &val) |
Append an element if not already in the list. More... | |
void | transfer (List< T > &list) |
template<int SizeMin> | |
void | transfer (DynamicList< T, SizeMin > &list) |
void | transfer (SortableList< T > &list) |
T & | newElmt (const label i) |
void | operator= (const UList< T > &a) |
Assignment to UList operator. Takes linear time. More... | |
void | operator= (const List< T > &list) |
Assignment operator. Takes linear time. More... | |
void | operator= (const SLList< T > &list) |
Assignment to SLList operator. Takes linear time. More... | |
template<class Addr > | |
void | operator= (const IndirectListBase< T, Addr > &list) |
Assignment from IndirectList. Takes linear time. More... | |
template<unsigned N> | |
void | operator= (const FixedList< T, N > &list) |
Copy assignment from FixedList. More... | |
void | operator= (std::initializer_list< T > list) |
Assignment to an initializer list. More... | |
void | operator= (const T &val) |
Assignment of all entries to the given value. More... | |
void | operator= (const Foam::zero) |
Assignment of all entries to zero. More... | |
void | operator= (List< T > &&list) |
Move assignment. Takes constant time. More... | |
template<int SizeMin> | |
void | operator= (DynamicList< T, SizeMin > &&list) |
Move assignment. Takes constant time. More... | |
void | operator= (SortableList< T > &&list) |
Move assignment. Takes constant time. More... | |
void | operator= (SLList< T > &&list) |
Move assignment. Takes constant time. More... | |
Istream & | readList (Istream &is) |
Read List from Istream, discarding contents of existing List. More... | |
void | shallowCopy (const UList< T > &)=delete |
No shallowCopy permitted. More... | |
template<class TypeT = T> | |
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type | set (const label i, bool val=true) |
A bitSet::set() method for a list of bool. More... | |
template<> | |
Istream & | readList (Istream &is) |
template<> | |
void | resize (const label newLen) |
template<> | |
Istream & | readList (Istream &is) |
Static Public Member Functions | |
template<class Type , class CombineOp , class TransformOp > | |
static void | syncData (List< Type > &elems, const labelListList &slaves, const labelListList &transformedSlaves, const mapDistribute &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 > &elems, const labelListList &slaves, const labelListList &transformedSlaves, const mapDistribute &slavesMap, const CombineOp &cop) |
Helper: synchronise data without transforms. More... | |
![]() | |
static lduSchedule | nonBlockingSchedule (const Container &patches) |
Calculate non-blocking (i.e. unscheduled) schedule. More... | |
![]() | |
static const List< T > & | null () |
Return a null List. More... | |
Static Public Attributes | |
static const Foam::scalar | matchTol_ = 1e-8 |
Geometric tolerance (fraction of bounding box) More... | |
Additional Inherited Members | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. More... | |
Various mesh related information for a parallel run. Upon construction, constructs all info using parallel communication.
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 'mapDistribute') 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
Definition at line 107 of file globalMeshData.H.
globalMeshData | ( | const polyMesh & | mesh | ) |
Construct from mesh, derive rest (does parallel communication!)
Definition at line 1746 of file globalMeshData.C.
References globalMeshData::updateMesh().
~globalMeshData | ( | ) |
Destructor.
Definition at line 1770 of file globalMeshData.C.
ClassName | ( | "globalMeshData" | ) |
Runtime type information.
void clearOut | ( | ) |
Remove all demand driven data.
Definition at line 1776 of file globalMeshData.C.
|
inlinenoexcept |
Return the mesh reference.
Definition at line 344 of file globalMeshData.H.
|
inline |
Does the mesh contain processor patches? (also valid when.
not running parallel)
Definition at line 351 of file globalMeshData.H.
|
inlinenoexcept |
Return total number of points in decomposed mesh. Not.
compensated for duplicate points!
Definition at line 358 of file globalMeshData.H.
|
inlinenoexcept |
Return total number of faces in decomposed mesh. Not.
compensated for duplicate faces!
Definition at line 365 of file globalMeshData.H.
|
inlinenoexcept |
Return total number of cells in decomposed mesh.
Definition at line 371 of file globalMeshData.H.
Referenced by velocityDampingConstraint::addDamping(), waveMethod::calculate(), structuredDecomp::decompose(), decompositionMethod::decompose(), meshRefinement::printMeshInfo(), and zoltanRenumber::renumber().
|
inlinenoexcept |
Return list of processor patch labels.
(size of list = number of processor patches)
Definition at line 381 of file globalMeshData.H.
Referenced by FaceCellWave< Type, TrackingData >::handleProcPatches(), transferModelList::info(), injectionModelList::info(), Cloud< passivePositionParticle >::move(), and patchInjection::patchInjection().
|
inlinenoexcept |
Return list of indices into processorPatches_ for each patch.
Index = -1 for non-processor parches. (size of list = number of patches)
Definition at line 389 of file globalMeshData.H.
|
inlinenoexcept |
Return processorPatchIndices of the neighbours.
processor patches. -1 if not running parallel.
Definition at line 396 of file globalMeshData.H.
Referenced by Cloud< passivePositionParticle >::move().
Foam::label nGlobalPoints | ( | ) | const |
Return number of globally shared points.
Definition at line 1986 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 1996 of file globalMeshData.C.
Referenced by polyMeshAdder::findSharedPoints(), 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 2006 of file globalMeshData.C.
Referenced by polyMeshAdder::findSharedPoints(), 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 1828 of file globalMeshData.C.
References Foam::endl(), forAll, IOobject::MUST_READ, pointLabels(), and Foam::Pout.
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 1879 of file globalMeshData.C.
References UPstream::blocking, forAll, UPstream::master(), UPstream::masterNo(), pointLabels(), and UPstream::subProcs().
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 1958 of file globalMeshData.C.
References Foam::combineReduce(), 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 2016 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 2026 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 2036 of file globalMeshData.C.
const Foam::indirectPrimitivePatch & coupledPatch | ( | ) | const |
Return patch of all coupled faces.
Definition at line 2046 of file globalMeshData.C.
References polyPatch::coupled(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::Pout, and polyPatch::start().
Referenced by addPatchCellLayer::calcExtrudeInfo(), createShellMesh::calcPointRegions(), globalIndexAndTransform::globalIndexAndTransform(), 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 2107 of file globalMeshData.C.
Referenced by syncTools::syncEdgeList().
const Foam::Map< Foam::label > & coupledPatchMeshEdgeMap | ( | ) | const |
Return map from mesh edges to coupledPatch edges.
Definition at line 2127 of file globalMeshData.C.
References forAll, and Foam::constant::atomic::me.
Referenced by syncTools::syncEdgeList().
const Foam::globalIndexAndTransform & globalTransforms | ( | ) | const |
Global transforms numbering.
Definition at line 2160 of file globalMeshData.C.
Referenced by addPatchCellLayer::calcExtrudeInfo(), PatchTools::edgeNormals(), PatchTools::pointNormals(), syncTools::syncEdgeList(), and syncTools::syncPointList().
|
static |
Helper: synchronise data with transforms.
Definition at line 37 of file globalMeshDataTemplates.C.
References mapDistribute::distribute(), forAll, and mapDistribute::reverseDistribute().
Referenced by addPatchCellLayer::calcExtrudeInfo(), PatchTools::edgeNormals(), syncTools::syncEdgeList(), and syncTools::syncPointList().
|
static |
Helper: synchronise data without transforms.
Definition at line 102 of file globalMeshDataTemplates.C.
References mapDistribute::distribute(), forAll, and mapDistribute::reverseDistribute().
const Foam::globalIndex & globalPointNumbering | ( | ) | const |
Numbering of coupled points is according to coupledPatch.
Definition at line 2146 of file globalMeshData.C.
References nPoints, and globalIndex::reset().
const Foam::labelListList & globalPointSlaves | ( | ) | const |
Definition at line 2170 of file globalMeshData.C.
Referenced by PatchTools::pointNormals(), and syncTools::syncPointList().
const Foam::labelListList & globalPointTransformedSlaves | ( | ) | const |
Definition at line 2180 of file globalMeshData.C.
Referenced by PatchTools::pointNormals(), and syncTools::syncPointList().
const Foam::mapDistribute & globalPointSlavesMap | ( | ) | const |
Definition at line 2191 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 159 of file globalMeshDataTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and PrimitivePatch< FaceList, PointField >::meshPoints().
Referenced by syncTools::syncPointList().
const Foam::globalIndex & globalEdgeNumbering | ( | ) | const |
Definition at line 2201 of file globalMeshData.C.
References globalIndex::reset().
const Foam::labelListList & globalEdgeSlaves | ( | ) | const |
Definition at line 2214 of file globalMeshData.C.
Referenced by addPatchCellLayer::calcExtrudeInfo(), PatchTools::edgeNormals(), and syncTools::syncEdgeList().
const Foam::labelListList & globalEdgeTransformedSlaves | ( | ) | const |
Definition at line 2224 of file globalMeshData.C.
Referenced by addPatchCellLayer::calcExtrudeInfo(), PatchTools::edgeNormals(), and syncTools::syncEdgeList().
const Foam::mapDistribute & globalEdgeSlavesMap | ( | ) | const |
Definition at line 2245 of file globalMeshData.C.
Referenced by addPatchCellLayer::calcExtrudeInfo(), PatchTools::edgeNormals(), and syncTools::syncEdgeList().
const Foam::bitSet & globalEdgeOrientation | ( | ) | const |
Is my edge same orientation as master edge.
Definition at line 2235 of file globalMeshData.C.
Referenced by syncTools::syncEdgeList().
const Foam::labelListList & globalCoPointSlaves | ( | ) | const |
Definition at line 2353 of file globalMeshData.C.
Referenced by globalIndexAndTransform::globalIndexAndTransform(), and pointConstraints::syncUntransformedData().
const Foam::mapDistribute & globalCoPointSlavesMap | ( | ) | const |
Definition at line 2363 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 2255 of file globalMeshData.C.
const Foam::labelListList & globalPointBoundaryFaces | ( | ) | const |
Definition at line 2266 of file globalMeshData.C.
const Foam::labelListList & globalPointTransformedBoundaryFaces | ( | ) | const |
Definition at line 2278 of file globalMeshData.C.
const Foam::mapDistribute & globalPointBoundaryFacesMap | ( | ) | const |
Definition at line 2288 of file globalMeshData.C.
const Foam::labelList & boundaryCells | ( | ) | const |
From boundary cell to mesh cell.
Definition at line 2299 of file globalMeshData.C.
const Foam::globalIndex & globalBoundaryCellNumbering | ( | ) | const |
Numbering of boundary cells is according to boundaryCells()
Definition at line 2309 of file globalMeshData.C.
const Foam::labelListList & globalPointBoundaryCells | ( | ) | const |
Definition at line 2320 of file globalMeshData.C.
const Foam::labelListList & globalPointTransformedBoundaryCells | ( | ) | const |
Definition at line 2332 of file globalMeshData.C.
const Foam::mapDistribute & globalPointBoundaryCellsMap | ( | ) | const |
Definition at line 2342 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 2374 of file globalMeshData.C.
References mapDistributeBase::constructSize(), forAll, PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::nPoints(), mapDistribute::reverseDistribute(), List< T >::setSize(), and globalIndex::toGlobal().
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
meshPointMap | currently unused |
Definition at line 2508 of file globalMeshData.C.
References mapDistributeBase::constructSize(), mapDistribute::distribute(), forAll, Foam::labelMax, PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::nPoints(), mapDistribute::reverseDistribute(), and List< T >::setSize().
void movePoints | ( | const pointField & | newPoints | ) |
Update for moving points.
Definition at line 2722 of file globalMeshData.C.
void updateMesh | ( | ) |
Change global mesh data given a topological change. Does a.
full parallel analysis to determine shared points and boundaries.
Definition at line 2731 of file globalMeshData.C.
References UPstream::allocateCommunicator(), Foam::expressions::patchExpr::debug, Foam::endl(), UPstream::freeCommunicator(), Foam::identity(), UPstream::msgType(), UPstream::nProcs(), Foam::Pout, Foam::returnReduce(), UPstream::warnComm, and UPstream::worldComm.
Referenced by globalMeshData::globalMeshData().
|
static |
Geometric tolerance (fraction of bounding box)
Definition at line 323 of file globalMeshData.H.