Class containing processor-to-processor mapping information. More...
Public Member Functions | |
ClassName ("mapDistributeBase") | |
mapDistributeBase () | |
Default construct (uses worldComm) More... | |
mapDistributeBase (const label comm) | |
Default construct with specified communicator. More... | |
mapDistributeBase (const mapDistributeBase &map) | |
Copy construct. More... | |
mapDistributeBase (mapDistributeBase &&map) | |
Move construct. More... | |
mapDistributeBase (const dictionary &dict, const label comm=UPstream::worldComm) | |
Read construct from dictionary. More... | |
mapDistributeBase (const label constructSize, labelListList &&subMap, labelListList &&constructMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
Move construct from components. More... | |
mapDistributeBase (const labelUList &sendProcs, const labelUList &recvProcs, const label comm=UPstream::worldComm) | |
mapDistributeBase (const globalIndex &, labelList &elements, List< Map< label > > &compactMap, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm) | |
mapDistributeBase (const globalIndex &, labelListList &cellCells, List< Map< label > > &compactMap, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm) | |
mapDistributeBase (labelListList &&subMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
Construct from my elements to send. More... | |
mapDistributeBase (Istream &is) | |
Construct from Istream. More... | |
label | constructSize () const noexcept |
Constructed data size. More... | |
label & | constructSize () noexcept |
Constructed data size. More... | |
const labelListList & | subMap () const noexcept |
From subsetted data back to original data. More... | |
labelListList & | subMap () noexcept |
From subsetted data back to original data. More... | |
const labelListList & | constructMap () const noexcept |
From subsetted data to new reconstructed data. More... | |
labelListList & | constructMap () noexcept |
From subsetted data to new reconstructed data. More... | |
bool | subHasFlip () const noexcept |
Does subMap include a sign. More... | |
bool & | subHasFlip () noexcept |
Does subMap include a sign. More... | |
bool | constructHasFlip () const noexcept |
Does constructMap include a sign. More... | |
bool & | constructHasFlip () noexcept |
Does constructMap include a sign. More... | |
label | comm () const noexcept |
The communicator used. More... | |
label | nMaps () const noexcept |
The number of sub-lists within the maps. More... | |
labelList | subMapSizes () const |
The sizes of the subMap lists. More... | |
labelList | constructMapSizes () const |
The sizes of the constructMap lists. More... | |
const List< labelPair > & | schedule () const |
Return a schedule. Demand driven. See above. More... | |
const List< labelPair > & | whichSchedule (const UPstream::commsTypes commsType) const |
void | clear () |
Reset to zero size, only retaining communicator. More... | |
void | transfer (mapDistributeBase &rhs) |
Transfer the contents of the argument and annul the argument. More... | |
void | compactLocalData (const bitSet &allowedLocalElems, const int tag=UPstream::msgType(), const bool doRenumber=false) |
void | compactRemoteData (const bitSet &allowedRemoteElems, const int tag=UPstream::msgType(), const bool doRenumber=false) |
void | compactLocalData (const bitSet &allowedLocalElems, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
void | compactRemoteData (const bitSet &allowedRemoteElems, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
void | compactData (const labelUList &localElements, const labelUList &remoteElements, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
void | compactLocalData (const labelUList &localElements, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
void | compactRemoteData (const labelUList &remoteElements, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
template<class T > | |
void | distribute (List< T > &values, const int tag=UPstream::msgType()) const |
template<class T > | |
void | distribute (DynamicList< T > &values, const int tag=UPstream::msgType()) const |
template<class T , class NegateOp > | |
void | distribute (List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
template<class T , class NegateOp > | |
void | distribute (const Pstream::commsTypes commsType, List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
template<class T , class NegateOp > | |
void | distribute (const Pstream::commsTypes commsType, const T &nullValue, List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const label constructSize, List< T > &values, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const label constructSize, const T &nullValue, List< T > &values, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const Pstream::commsTypes commsType, const label constructSize, List< T > &values, const int tag=UPstream::msgType()) const |
template<class T , class NegateOp > | |
void | reverseDistribute (const Pstream::commsTypes commsType, const label constructSize, List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const Pstream::commsTypes commsType, const label constructSize, const T &nullValue, List< T > &values, const int tag=UPstream::msgType()) const |
template<class T > | |
void | send (PstreamBuffers &pBufs, const List< T > &field) const |
Do all sends using PstreamBuffers. More... | |
template<class T > | |
void | receive (PstreamBuffers &pBufs, List< T > &field) const |
Do all receives using PstreamBuffers. More... | |
void | printLayout (Ostream &os) const |
Debug: print layout. Can only be used on maps with sorted. More... | |
void | operator= (const mapDistributeBase &rhs) |
Copy assignment. More... | |
void | operator= (mapDistributeBase &&rhs) |
Move assignment. More... | |
InfoProxy< mapDistributeBase > | info () const |
Info proxy to print summary information to a stream. More... | |
void | readDict (const dictionary &dict) |
Read entries from dictionary format. More... | |
void | writeEntries (Ostream &os) const |
Write entries in dictionary format. More... | |
void | updateMesh (const mapPolyMesh &) |
No correction for topo change. More... | |
void | compact (const boolList &remoteElemUsed, const int tag=UPstream::msgType()) |
void | compact (const boolList &remoteElemUsed, const label localSize, labelList &oldToNewSub, labelList &oldToNewConstruct, const int tag=UPstream::msgType()) |
template<class T , class NegateOp > | |
Foam::List< T > | accessAndFlip (const UList< T > &values, const labelUList &indices, const bool hasFlip, const NegateOp &negOp) |
Static Public Member Functions | |
static bool | hasFlipAddressing (const labelUList &map) |
static bool | hasFlipAddressing (const labelListList &maps) |
static label | countUnmapped (const labelUList &elements, const labelListList &maps, const bool hasFlip) |
Count the number of unmapped elements. More... | |
static List< labelPair > | schedule (const labelListList &subMap, const labelListList &constructMap, const int tag, const label comm=UPstream::worldComm) |
Calculate a communication schedule. See above. More... | |
static label | renumber (const globalIndex &, const List< Map< label > > &compactMap, const label globalElement) |
Helper for construct from globalIndex. Renumbers element. More... | |
static label | renumberMap (labelListList &mapElements, const labelUList &oldToNew, const bool hasFlip) |
template<class T , class NegateOp > | |
static void | distribute (const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) |
Distribute data with specified negate operator (for flips). More... | |
template<class T , class CombineOp , class NegateOp > | |
static void | distribute (const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) |
Distribute data with specified combine operation. More... | |
Protected Member Functions | |
void | calcCompactAddressing (const globalIndex &globalNumbering, const labelUList &elements, List< Map< label > > &compactMap) const |
Construct per processor compact addressing of the global elements. More... | |
void | calcCompactAddressing (const globalIndex &globalNumbering, const labelListList &elements, List< Map< label > > &compactMap) const |
void | exchangeAddressing (const int tag, const globalIndex &globalNumbering, labelList &elements, List< Map< label > > &compactMap, labelList &compactStart) |
void | exchangeAddressing (const int tag, const globalIndex &globalNumbering, labelListList &elements, List< Map< label > > &compactMap, labelList &compactStart) |
Static Protected Member Functions | |
static void | checkReceivedSize (const label proci, const label expectedSize, const label receivedSize) |
Fatal if expected and received size are not equal. More... | |
static label | getMappedSize (const labelListList &maps, const bool hasFlip) |
Scan the maps for the max addressed index. More... | |
static void | exchangeMasks (const UList< bitSet > &sendMasks, UList< bitSet > &recvMasks, const int tag, const label comm) |
Synchronize send/recv mask buffers as a 'copy' operation. More... | |
static void | unionCombineMasks (UList< bitSet > &sendMasks, UList< bitSet > &recvMasks, const int tag, const label comm) |
template<class T , class CombineOp , class NegateOp > | |
static void | flipAndCombine (const labelUList &map, const bool hasFlip, const UList< T > &rhs, const CombineOp &cop, const NegateOp &negOp, List< T > &lhs) |
template<class T , class NegateOp > | |
static T | accessAndFlip (const UList< T > &values, const label index, const bool hasFlip, const NegateOp &negOp) |
template<class T , class NegateOp > | |
static List< T > | accessAndFlip (const UList< T > &values, const labelUList &indices, const bool hasFlip, const NegateOp &negOp) |
Friends | |
Istream & | operator>> (Istream &, mapDistributeBase &) |
Read plain content (not dictionary) from Istream. More... | |
Ostream & | operator<< (Ostream &, const mapDistributeBase &) |
Write plain content (not dictionary) to Ostream. More... | |
Class containing processor-to-processor mapping information.
We store mapping from the bits-to-send to the complete starting list (subXXXMap) and from the received bits to their location in the new list (constructXXXMap).
Note: Schedule is a list of processor pairs (one send, one receive. One of them will be myself) which forms a scheduled (i.e. non-buffered) exchange. See distribute on how to use it. Note2: number of items sent on one processor have to equal the number of items received on the other processor.
To aid constructing these maps there are the constructors from global numbering, either with or without transforms.
Constructors using compact numbering: layout is
It rewrites the input global indices into indices into the constructed data.
When constructing from components optionally a 'flip' on the maps can be specified. This will interpret the map values as index+flip, similar to e.g. faceProcAddressing. The flip will only be applied to fieldTypes (scalar, vector, .. triad)
Definition at line 105 of file mapDistributeBase.H.
Default construct (uses worldComm)
Definition at line 654 of file mapDistributeBase.C.
|
explicit |
Default construct with specified communicator.
Definition at line 660 of file mapDistributeBase.C.
mapDistributeBase | ( | const mapDistributeBase & | map | ) |
Copy construct.
Definition at line 672 of file mapDistributeBase.C.
mapDistributeBase | ( | mapDistributeBase && | map | ) |
Move construct.
Definition at line 684 of file mapDistributeBase.C.
References mapDistributeBase::transfer().
|
explicit |
Read construct from dictionary.
Definition at line 80 of file mapDistributeBaseIO.C.
References dict.
mapDistributeBase | ( | const label | constructSize, |
labelListList && | subMap, | ||
labelListList && | constructMap, | ||
const bool | subHasFlip = false , |
||
const bool | constructHasFlip = false , |
||
const label | comm = UPstream::worldComm |
||
) |
Move construct from components.
Definition at line 692 of file mapDistributeBase.C.
mapDistributeBase | ( | const labelUList & | sendProcs, |
const labelUList & | recvProcs, | ||
const label | comm = UPstream::worldComm |
||
) |
Construct from reverse addressing: per data item the send processor and the receive processor.
Definition at line 712 of file mapDistributeBase.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.
mapDistributeBase | ( | const globalIndex & | globalNumbering, |
labelList & | elements, | ||
List< Map< label > > & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Construct from list of (possibly) remote elements in globalIndex numbering (or -1).
Determines compact numbering (see above) and distribute map to get data into this ordering and renumbers the elements to be in compact numbering.
Definition at line 797 of file mapDistributeBase.C.
References mapDistributeBase::calcCompactAddressing(), mapDistributeBase::exchangeAddressing(), Foam::Pout, and mapDistributeBase::printLayout().
mapDistributeBase | ( | const globalIndex & | globalNumbering, |
labelListList & | cellCells, | ||
List< Map< label > > & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Special variant that works with the info sorted into bins according to local indices.
E.g. think cellCells where cellCells[localCellI] is a list of global cells
Definition at line 860 of file mapDistributeBase.C.
References mapDistributeBase::calcCompactAddressing(), mapDistributeBase::exchangeAddressing(), Foam::Pout, and mapDistributeBase::printLayout().
|
explicit |
Construct from my elements to send.
Assumes layout is my elements first followed by elements from all other processors in consecutive order.
Definition at line 923 of file mapDistributeBase.C.
References Pstream::exchangeSizes(), forAll, Foam::identity(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), and List< T >::resize().
|
explicit |
Construct from Istream.
Definition at line 92 of file mapDistributeBaseIO.C.
|
staticprotected |
Fatal if expected and received size are not equal.
Definition at line 166 of file mapDistributeBase.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
staticprotected |
Scan the maps for the max addressed index.
maps | The maps to scan |
hasFlip | True if maps has flip addressing |
Definition at line 89 of file mapDistributeBase.C.
References Foam::mag(), and Foam::max().
|
protected |
Construct per processor compact addressing of the global elements.
needed. The ones from the local processor are not included since these are always all needed.
Definition at line 387 of file mapDistributeBase.C.
References processorFaPatch::myProcNo(), and PstreamBuffers::nProcs().
Referenced by mapDistribute::mapDistribute(), and mapDistributeBase::mapDistributeBase().
|
protected |
Definition at line 435 of file mapDistributeBase.C.
References forAll, globalIndex::isLocal(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), List< T >::resize_nocopy(), globalIndex::toLocal(), and Foam::Zero.
|
protected |
Definition at line 489 of file mapDistributeBase.C.
References forAll, forAllIters, Foam::identity(), globalIndex::localSize(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), Foam::renumber(), List< T >::setSize(), and UList< T >::size().
Referenced by mapDistribute::mapDistribute(), and mapDistributeBase::mapDistributeBase().
|
protected |
Definition at line 569 of file mapDistributeBase.C.
References forAll, forAllIters, Foam::identity(), globalIndex::localSize(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), Foam::renumber(), List< T >::setSize(), and UList< T >::size().
|
staticprotected |
Synchronize send/recv mask buffers as a 'copy' operation.
Somewhat similar to Pstream::exchangeContainer
The masks must be properly sized by the caller, which avoids a needless all-to-all for the sizes and the sizing is already given by the maps.
Definition at line 119 of file mapDistributeBaseSubset.C.
References Foam::abort(), mapDistributeBase::comm(), Foam::FatalError, FatalErrorInFunction, forAll, processorFaPatch::myProcNo(), Foam::nl, UPstream::nonBlocking, PstreamBuffers::nProcs(), UPstream::nRequests(), UPstream::parRun(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::read(), UList< T >::size(), UPstream::waitRequests(), and ObukhovLength::write().
|
staticprotected |
Bi-direction sync of send/recv buffers using bitwise '&=' combine operation.
The masks must be properly sized by the caller, which avoids a needless all-to-all for the sizes and the sizing is already given by the maps.
Definition at line 198 of file mapDistributeBaseSubset.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, processorFaPatch::myProcNo(), Foam::nl, UPstream::parRun(), List< T >::resize(), and UList< T >::size().
|
staticprotected |
Definition at line 36 of file mapDistributeBaseTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().
|
staticprotected |
Lookup a field value at specified index and return its value after any flip negation operations
Definition at line 81 of file mapDistributeBaseTemplates.C.
References Foam::exit(), Foam::FatalError, and FatalErrorInFunction.
|
staticprotected |
Lookup field values at specified indices and return after any flip negation operations
ClassName | ( | "mapDistributeBase" | ) |
|
static |
Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as positive non-zero indices.
Exits early on the first detected zero or negative, which makes this more efficient than testing min(map) < 0.
Definition at line 46 of file mapDistributeBase.C.
|
static |
Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as positive non-zero indices.
See notes above.
Definition at line 66 of file mapDistributeBase.C.
|
static |
Count the number of unmapped elements.
elements | The elements that are expected to be mapped |
maps | The maps to scan |
hasFlip | True if maps has flip addressing |
Definition at line 114 of file mapDistributeBase.C.
References bitSet::count(), UList< T >::empty(), Foam::mag(), and bitSet::unset().
|
inlinenoexcept |
Constructed data size.
Definition at line 485 of file mapDistributeBase.H.
Referenced by AMIInterpolation::agglomerate(), LeastSquaresGrad< Type, Stencil >::calcGrad(), extendedCellToFaceStencil::collectData(), extendedFaceToCellStencil::collectData(), meshRefinement::countEdgeFaces(), faMeshDistributor::distribute(), mappedPatchFieldBase< Type >::distribute(), faMeshBoundaryHalo::distributeSparse(), PatchTools::edgeNormals(), globalIndexAndTransform::globalIndexAndTransform(), mapDistribute::mapDistribute(), globalMeshData::mergePoints(), PatchTools::pointNormals(), DistributedFieldMapper< DirectFieldMapperType >::size(), distributedWeightedFvPatchFieldMapper::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), pointConstraints::syncUntransformedData(), dynamicOversetFvMesh::updateAddressing(), faMeshTools::writeProcAddressing(), and streamLineBase::writeToFile().
|
inlinenoexcept |
Constructed data size.
Definition at line 491 of file mapDistributeBase.H.
|
inlinenoexcept |
From subsetted data back to original data.
Definition at line 497 of file mapDistributeBase.H.
Referenced by AMIInterpolation::agglomerate(), faMeshDistributor::distribute(), refinementHistory::distribute(), mappedPatchFieldBase< Type >::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), extendedCellToFaceStencil::writeStencilStats(), and streamLineBase::writeToFile().
|
inlinenoexcept |
From subsetted data back to original data.
Definition at line 503 of file mapDistributeBase.H.
|
inlinenoexcept |
From subsetted data to new reconstructed data.
Definition at line 509 of file mapDistributeBase.H.
Referenced by AMIInterpolation::agglomerate(), faMeshDistributor::distribute(), refinementHistory::distribute(), mappedPatchFieldBase< Type >::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), mappedPatchFieldBase< Type >::mappedPatchFieldBase(), and streamLineBase::writeToFile().
|
inlinenoexcept |
From subsetted data to new reconstructed data.
Definition at line 515 of file mapDistributeBase.H.
|
inlinenoexcept |
Does subMap include a sign.
Definition at line 521 of file mapDistributeBase.H.
Referenced by faMeshDistributor::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), and fvMeshTools::writeProcAddressing().
|
inlinenoexcept |
Does subMap include a sign.
Definition at line 527 of file mapDistributeBase.H.
|
inlinenoexcept |
Does constructMap include a sign.
Definition at line 533 of file mapDistributeBase.H.
Referenced by faMeshDistributor::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), and fvMeshTools::writeProcAddressing().
|
inlinenoexcept |
Does constructMap include a sign.
Definition at line 539 of file mapDistributeBase.H.
|
inlinenoexcept |
The communicator used.
Definition at line 545 of file mapDistributeBase.H.
Referenced by faMeshDistributor::distribute(), mapDistributeBase::exchangeMasks(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), and mapDistribute::mapDistribute().
|
inlinenoexcept |
The number of sub-lists within the maps.
Definition at line 551 of file mapDistributeBase.H.
References UList< T >::size().
Foam::labelList subMapSizes | ( | ) | const |
The sizes of the subMap lists.
Definition at line 975 of file mapDistributeBase.C.
References forAll, and UList< T >::size().
Foam::labelList constructMapSizes | ( | ) | const |
The sizes of the constructMap lists.
Definition at line 987 of file mapDistributeBase.C.
References forAll, and UList< T >::size().
|
static |
Calculate a communication schedule. See above.
Definition at line 186 of file mapDistributeBase.C.
References List< T >::appendUniq(), Pstream::broadcast(), forAll, HashSet< Key, Hash >::insert(), splitCell::master(), UPstream::masterNo(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), UPstream::parRun(), UPstream::scheduled, PstreamBuffers::subProcs(), and HashTable< T, Key, Hash >::toc().
Referenced by streamLineBase::writeToFile().
const Foam::List< Foam::labelPair > & schedule | ( | ) | const |
Return a schedule. Demand driven. See above.
Definition at line 280 of file mapDistributeBase.C.
References UPstream::msgType().
const Foam::List< Foam::labelPair > & whichSchedule | ( | const UPstream::commsTypes | commsType | ) | const |
Return real or dummy schedule depending on the communication type
Definition at line 297 of file mapDistributeBase.C.
References List< T >::null(), and UPstream::scheduled.
void clear | ( | ) |
Reset to zero size, only retaining communicator.
Definition at line 999 of file mapDistributeBase.C.
Referenced by mapDistribute::clear().
void transfer | ( | mapDistributeBase & | rhs | ) |
Transfer the contents of the argument and annul the argument.
Definition at line 1011 of file mapDistributeBase.C.
Referenced by mapDistributeBase::mapDistributeBase().
|
static |
Helper for construct from globalIndex. Renumbers element.
(in globalIndex numbering) into compact indices.
Definition at line 1033 of file mapDistributeBase.C.
References globalIndex::isLocal(), mapDistributeBase::renumber(), and globalIndex::toLocal().
Referenced by mapDistributeBase::renumber().
|
static |
Helper for renumbering the (compacted) map elements using the supplied old-to-new mapping.
Only compacts the maps, does not change the local layout.
[in,out] | mapElements | The map to be renumbered |
oldToNew | The old-to-new mapping | |
hasFlip | True if map has flip addressing |
Definition at line 280 of file mapDistributeBaseSubset.C.
References Foam::mag(), and Foam::max().
Referenced by faMeshDistributor::distribute().
void compactLocalData | ( | const bitSet & | allowedLocalElems, |
const int | tag = UPstream::msgType() , |
||
const bool | doRenumber = false |
||
) |
Compact send/receive maps based on selection of originating local (send) elements.
Determines and removes the correspondingly unneeded elements in the send/receive maps. Only compacts the maps, does not change the local layout.
allowedLocalElems | Permissible local mapped elements (true/false). Can be longer/shorter than actual number of mapped elements. |
tag | The message tag |
doRenumber | Apply oldToNew internally to renumber entries (uses renumberMap) and adjust the constructSize |
Definition at line 801 of file mapDistributeBaseSubset.C.
Referenced by faMeshDistributor::distribute().
void compactRemoteData | ( | const bitSet & | allowedRemoteElems, |
const int | tag = UPstream::msgType() , |
||
const bool | doRenumber = false |
||
) |
Compact send/receive maps based on selection of remote (receive) elements.
Determines and removes the correspondingly unneeded elements in the send/receive maps. Only compacts the maps, does not change the local layout.
allowedRemoteElems | Permissible remote mapped elements (true/false). Can be longer/shorter than actual number of mapped elements. |
tag | The message tag |
doRenumber | Apply oldToNew internally to renumber entries (uses renumberMap) and adjust the constructSize |
Definition at line 823 of file mapDistributeBaseSubset.C.
void compactLocalData | ( | const bitSet & | allowedLocalElems, |
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const label | localSize = -1 , |
||
const int | tag = UPstream::msgType() |
||
) |
Compact send/receive maps based on selection of originating local (send) elements. Returns compaction mappings for subMap and constructMap.
allowedLocalElems | Permissible local mapped elements (true/false). Can be longer/shorter than actual number of mapped elements. | |
[out] | oldToNewSub | Old-to-new mapping: subMap Disabled if labelList::null(), |
[out] | oldToNewConstruct | Old-to-new mapping: constructMap Disabled if labelList::null(), |
localSize | The max index for subMap (-1: auto-detect) | |
tag | The message tag |
Definition at line 845 of file mapDistributeBaseSubset.C.
void compactRemoteData | ( | const bitSet & | allowedRemoteElems, |
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const label | localSize = -1 , |
||
const int | tag = UPstream::msgType() |
||
) |
Compact send/receive maps based on selection of remote (receive) elements. Returns compaction mappings for subMap and constructMap.
allowedRemoteElems | Permissible remote mapped elements (true/false). Can be longer/shorter than actual number of mapped elements. | |
[out] | oldToNewSub | Old-to-new mapping: subMap Disabled if labelList::null(), |
[out] | oldToNewConstruct | Old-to-new mapping: constructMap Disabled if labelList::null(), |
localSize | The max index for subMap (-1: auto-detect) | |
tag | The message tag |
Definition at line 876 of file mapDistributeBaseSubset.C.
void compactData | ( | const labelUList & | localElements, |
const labelUList & | remoteElements, | ||
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const label | localSize = -1 , |
||
const int | tag = UPstream::msgType() |
||
) |
Compact send/receive maps based on selection of originating local (send) and remote (receive) elements.
The resulting compact numbering:
subMap
(and oldToNewSub
) : will follow the original ordering of localElements
.constructMap
(and oldToNewConstruct
) : will follow the original ordering of remoteElements
.localElements
or remoteElements
contains duplicates. Definition at line 629 of file mapDistributeBaseSubset.C.
void compactLocalData | ( | const labelUList & | localElements, |
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const label | localSize = -1 , |
||
const int | tag = UPstream::msgType() |
||
) |
Compact send/receive maps based on selection of originating local (send) elements.
The resulting compact numbering:
subMap
(and oldToNewSub
) : will follow the original ordering of localElements
.constructMap
(and oldToNewConstruct
) : numbered in simple ascending order.localElements
contains duplicates.Definition at line 681 of file mapDistributeBaseSubset.C.
void compactRemoteData | ( | const labelUList & | remoteElements, |
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const label | localSize = -1 , |
||
const int | tag = UPstream::msgType() |
||
) |
Compact send/receive maps based on selection of remote (receive) elements.
The resulting compact numbering:
subMap
(and oldToNewSub
) : numbered in simple ascending order.constructMap
(and oldToNewConstruct
) : will follow the original ordering of remoteElements
.remoteElements
contains duplicates. Definition at line 723 of file mapDistributeBaseSubset.C.
|
static |
Distribute data with specified negate operator (for flips).
Definition at line 164 of file mapDistributeBaseTemplates.C.
References Foam::abort(), PstreamBuffers::allProcs(), UPstream::blocking, mapDistributeBase::distribute(), Foam::FatalError, FatalErrorInFunction, field(), PstreamBuffers::finishedSends(), processorFaPatch::myProcNo(), UPstream::nonBlocking, PstreamBuffers::nProcs(), UPstream::nRequests(), UPstream::parRun(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::read(), List< T >::resize(), UPstream::scheduled, UList< T >::size(), UPstream::waitRequests(), and ObukhovLength::write().
Referenced by mapDistributeBase::distribute(), Field< T >::negate(), and Field< T >::operator=().
|
static |
Distribute data with specified combine operation.
If multiple processors writing to same position adds contributions using cop.
Definition at line 629 of file mapDistributeBaseTemplates.C.
References Foam::abort(), PstreamBuffers::allProcs(), UPstream::blocking, mapDistributeBase::distribute(), Foam::FatalError, FatalErrorInFunction, field(), PstreamBuffers::finishedSends(), processorFaPatch::myProcNo(), UPstream::nonBlocking, PstreamBuffers::nProcs(), UPstream::nRequests(), UPstream::parRun(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::read(), UPstream::scheduled, List< T >::setSize(), UList< T >::size(), UPstream::waitRequests(), and ObukhovLength::write().
void distribute | ( | List< T > & | values, |
const int | tag = UPstream::msgType() |
||
) | const |
Distribute data using default commsType and the default flip/negate operator.
Definition at line 1227 of file mapDistributeBaseTemplates.C.
References mapDistributeBase::distribute().
void distribute | ( | DynamicList< T > & | values, |
const int | tag = UPstream::msgType() |
||
) | const |
Distribute data using default commsType and the default flip/negate operator.
Definition at line 1238 of file mapDistributeBaseTemplates.C.
References mapDistributeBase::distribute(), and UList< T >::size().
void distribute | ( | List< T > & | values, |
const NegateOp & | negOp, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Distribute data using default commsType and the specified negate operator (for flips).
Definition at line 1212 of file mapDistributeBaseTemplates.C.
References UPstream::defaultCommsType, and mapDistributeBase::distribute().
void distribute | ( | const Pstream::commsTypes | commsType, |
List< T > & | values, | ||
const NegateOp & | negOp, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Distribute data using specified commsType and the specified negate operator (for flips).
Accepts a nullValue to initialize unmapped elements (ie, when the constructSize is larger than the number of mapped elements).
Definition at line 1157 of file mapDistributeBaseTemplates.C.
References mapDistributeBase::distribute().
void distribute | ( | const Pstream::commsTypes | commsType, |
const T & | nullValue, | ||
List< T > & | values, | ||
const NegateOp & | negOp, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Distribute data using specified commsType and the specified negate operator (for flips).
Accepts a nullValue to initialize unmapped elements (ie, when the constructSize is larger than the number of mapped elements).
Definition at line 1183 of file mapDistributeBaseTemplates.C.
References mapDistributeBase::distribute().
void reverseDistribute | ( | const label | constructSize, |
List< T > & | values, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Reverse distribute data using default commsType and the default flip/negate operator
Definition at line 1333 of file mapDistributeBaseTemplates.C.
References UPstream::defaultCommsType.
Referenced by faMeshDistributor::distribute(), and mapDistribute::reverseDistribute().
void reverseDistribute | ( | const label | constructSize, |
const T & | nullValue, | ||
List< T > & | values, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Reverse distribute data using default commsType and the default flip/negate operator.
Accepts a nullValue to initialize unmapped elements (ie, when the constructSize is larger than the subMap).
Definition at line 1351 of file mapDistributeBaseTemplates.C.
References UPstream::defaultCommsType.
void reverseDistribute | ( | const Pstream::commsTypes | commsType, |
const label | constructSize, | ||
List< T > & | values, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Reverse distribute data using specified commsType and the default flip/negate operator
Definition at line 1255 of file mapDistributeBaseTemplates.C.
void reverseDistribute | ( | const Pstream::commsTypes | commsType, |
const label | constructSize, | ||
List< T > & | values, | ||
const NegateOp & | negOp, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Reverse distribute data using specified commsType and the specified flip/negate operator.
Definition at line 1275 of file mapDistributeBaseTemplates.C.
void reverseDistribute | ( | const Pstream::commsTypes | commsType, |
const label | constructSize, | ||
const T & | nullValue, | ||
List< T > & | values, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Reverse distribute data using specified commsType and the default flip/negate operator.
Accepts a nullValue to initialize unmapped elements (ie, when the constructSize is larger than the subMap).
Definition at line 1302 of file mapDistributeBaseTemplates.C.
void send | ( | PstreamBuffers & | pBufs, |
const List< T > & | field | ||
) | const |
Do all sends using PstreamBuffers.
Definition at line 1090 of file mapDistributeBaseTemplates.C.
References PstreamBuffers::allProcs(), field(), PstreamBuffers::finishedSends(), and UList< T >::size().
void receive | ( | PstreamBuffers & | pBufs, |
List< T > & | field | ||
) | const |
Do all receives using PstreamBuffers.
Definition at line 1118 of file mapDistributeBaseTemplates.C.
References Foam::abort(), PstreamBuffers::allProcs(), Foam::FatalError, FatalErrorInFunction, field(), and UList< T >::size().
void printLayout | ( | Ostream & | os | ) | const |
Debug: print layout. Can only be used on maps with sorted.
storage (local data first, then non-local data)
Definition at line 311 of file mapDistributeBase.C.
References Foam::endl(), forAll, Foam::labelMax, Foam::labelMin, Foam::mag(), Foam::max(), Foam::min(), processorFaPatch::myProcNo(), Foam::nl, PstreamBuffers::nProcs(), and os().
Referenced by mapDistributeBase::mapDistributeBase(), and mapDistribute::printLayout().
void operator= | ( | const mapDistributeBase & | rhs | ) |
Copy assignment.
Definition at line 1059 of file mapDistributeBase.C.
Referenced by mapDistribute::operator=().
void operator= | ( | mapDistributeBase && | rhs | ) |
Move assignment.
Definition at line 1076 of file mapDistributeBase.C.
|
inline |
Info proxy to print summary information to a stream.
Definition at line 973 of file mapDistributeBase.H.
void readDict | ( | const dictionary & | dict | ) |
Read entries from dictionary format.
Definition at line 100 of file mapDistributeBaseIO.C.
References dict, dictionary::get(), mapDistributeBase::readDict(), dictionary::readEntry(), and dictionary::subDict().
Referenced by mapDistributeBase::readDict().
void writeEntries | ( | Ostream & | os | ) | const |
Write entries in dictionary format.
Definition at line 122 of file mapDistributeBaseIO.C.
References Ostream::beginBlock(), Ostream::endBlock(), Foam::nl, os(), Ostream::writeEntry(), and Foam::writeMaps().
Referenced by mapDistribute::writeEntries().
|
inline |
No correction for topo change.
Definition at line 994 of file mapDistributeBase.H.
References NotImplemented.
void compact | ( | const boolList & | remoteElemUsed, |
const int | tag = UPstream::msgType() |
||
) |
OpenFOAM-v2112 and earlier naming for compactRemoteData() using boolList.
Definition at line 909 of file mapDistributeBaseSubset.C.
void compact | ( | const boolList & | remoteElemUsed, |
const label | localSize, | ||
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const int | tag = UPstream::msgType() |
||
) |
OpenFOAM-v2112 and earlier naming for compactRemoteData(). using boolList.
Definition at line 920 of file mapDistributeBaseSubset.C.
Foam::List< T > accessAndFlip | ( | const UList< T > & | values, |
const labelUList & | indices, | ||
const bool | hasFlip, | ||
const NegateOp & | negOp | ||
) |
Definition at line 114 of file mapDistributeBaseTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::output(), and UList< T >::size().
|
friend |
Read plain content (not dictionary) from Istream.
|
friend |
Write plain content (not dictionary) to Ostream.