Class containing processor-to-processor mapping information. More...
Public Member Functions | |
ClassName ("mapDistributeBase") | |
mapDistributeBase (const label comm=UPstream::worldComm) | |
mapDistributeBase (const mapDistributeBase &map) | |
mapDistributeBase (mapDistributeBase &&map) | |
mapDistributeBase (const label constructSize, labelListList &&subMap, labelListList &&constructMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
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) | |
mapDistributeBase (Istream &is) | |
label | constructSize () const |
label & | constructSize () |
const labelListList & | subMap () const |
labelListList & | subMap () |
const labelListList & | constructMap () const |
labelListList & | constructMap () |
bool | subHasFlip () const |
bool & | subHasFlip () |
bool | constructHasFlip () const |
bool & | constructHasFlip () |
label | comm () const |
const List< labelPair > & | schedule () const |
void | transfer (mapDistributeBase &rhs) |
void | compact (const boolList &elemIsUsed, const int tag=UPstream::msgType()) |
void | compact (const boolList &elemIsUsed, const label localSize, labelList &oldToNewSub, labelList &oldToNewConstruct, const int tag=UPstream::msgType()) |
template<class T > | |
void | distribute (List< T > &fld, const int tag=UPstream::msgType()) const |
template<class T , class negateOp > | |
void | distribute (List< T > &fld, const negateOp &negOp, const int tag=UPstream::msgType()) const |
template<class T > | |
void | distribute (DynamicList< T > &fld, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const label constructSize, List< T > &, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const label constructSize, const T &nullValue, List< T > &fld, const int tag=UPstream::msgType()) const |
template<class T > | |
void | send (PstreamBuffers &, const List< T > &) const |
template<class T > | |
void | receive (PstreamBuffers &, List< T > &) const |
void | printLayout (Ostream &os) const |
void | updateMesh (const mapPolyMesh &) |
void | operator= (const mapDistributeBase &rhs) |
void | operator= (mapDistributeBase &&rhs) |
Static Public Member Functions | |
static List< labelPair > | schedule (const labelListList &subMap, const labelListList &constructMap, const int tag, const label comm=UPstream::worldComm) |
static label | renumber (const globalIndex &, const List< Map< label >> &compactMap, const label globalElement) |
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 > &, const negateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) |
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 > &, const T &nullValue, const CombineOp &cop, const negateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) |
Protected Member Functions | |
void | calcCompactAddressing (const globalIndex &globalNumbering, const labelUList &elements, List< Map< label >> &compactMap) const |
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) |
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 > &fld, const label index, const bool hasFlip, const negateOp &negOp) |
Protected Attributes | |
label | constructSize_ |
labelListList | subMap_ |
labelListList | constructMap_ |
bool | subHasFlip_ |
bool | constructHasFlip_ |
label | comm_ |
autoPtr< List< labelPair > > | schedulePtr_ |
Friends | |
Istream & | operator>> (Istream &, mapDistributeBase &) |
Ostream & | operator<< (Ostream &, const mapDistributeBase &) |
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 99 of file mapDistributeBase.H.
mapDistributeBase | ( | const label | comm = UPstream::worldComm | ) |
Definition at line 559 of file mapDistributeBase.C.
mapDistributeBase | ( | const mapDistributeBase & | map | ) |
Definition at line 570 of file mapDistributeBase.C.
mapDistributeBase | ( | mapDistributeBase && | map | ) |
Definition at line 582 of file mapDistributeBase.C.
References mapDistributeBase::transfer().
mapDistributeBase | ( | const label | constructSize, |
labelListList && | subMap, | ||
labelListList && | constructMap, | ||
const bool | subHasFlip = false , |
||
const bool | constructHasFlip = false , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 591 of file mapDistributeBase.C.
mapDistributeBase | ( | const labelUList & | sendProcs, |
const labelUList & | recvProcs, | ||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 611 of file mapDistributeBase.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::myProcNo(), UPstream::nProcs(), List::setSize(), UList::size(), and Foam::Zero.
mapDistributeBase | ( | const globalIndex & | globalNumbering, |
labelList & | elements, | ||
List< Map< label >> & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 690 of file mapDistributeBase.C.
References Foam::expressions::patchExpr::debug, and Foam::Pout.
mapDistributeBase | ( | const globalIndex & | globalNumbering, |
labelListList & | cellCells, | ||
List< Map< label >> & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 751 of file mapDistributeBase.C.
References Foam::expressions::patchExpr::debug, and Foam::Pout.
|
explicit |
Definition at line 812 of file mapDistributeBase.C.
References Pstream::exchangeSizes(), forAll, UPstream::myProcNo(), UPstream::nProcs(), List::setSize(), and List::transfer().
mapDistributeBase | ( | Istream & | is | ) |
Definition at line 868 of file mapDistributeBase.C.
|
staticprotected |
Definition at line 197 of file mapDistributeBase.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
protected |
Definition at line 292 of file mapDistributeBase.C.
References forAll, globalIndex::isLocal(), UPstream::myProcNo(), UPstream::nProcs(), globalIndex::toLocal(), globalIndex::whichProcID(), and Foam::Zero.
|
protected |
Definition at line 340 of file mapDistributeBase.C.
References forAll, globalIndex::isLocal(), UPstream::myProcNo(), UPstream::nProcs(), globalIndex::toLocal(), globalIndex::whichProcID(), and Foam::Zero.
|
protected |
Definition at line 394 of file mapDistributeBase.C.
References forAll, forAllIters, Foam::identity(), globalIndex::localSize(), UPstream::myProcNo(), UPstream::nProcs(), Foam::renumber(), and List::setSize().
|
protected |
Definition at line 475 of file mapDistributeBase.C.
References forAll, forAllIters, Foam::identity(), globalIndex::localSize(), UPstream::myProcNo(), UPstream::nProcs(), Foam::renumber(), and List::setSize().
|
staticprotected |
Definition at line 31 of file mapDistributeBaseTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and UList::size().
|
staticprotected |
Definition at line 76 of file mapDistributeBaseTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, and T.
Referenced by mapDistributeBase::send().
ClassName | ( | "mapDistributeBase" | ) |
|
inline |
Definition at line 273 of file mapDistributeBase.H.
References mapDistributeBase::constructSize_.
Referenced by AMIInterpolation::agglomerate(), extendedCellToFaceStencil::collectData(), extendedFaceToCellStencil::collectData(), mappedPatchFieldBase< scalar >::distribute(), PatchTools::edgeNormals(), globalIndexAndTransform::globalIndexAndTransform(), globalMeshData::mergePoints(), PatchTools::pointNormals(), distributedUnallocatedDirectFieldMapper::size(), distributedUnallocatedDirectFvPatchFieldMapper::size(), distributedWeightedFvPatchFieldMapper::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), pointConstraints::syncUntransformedData(), and streamLineBase::writeToFile().
|
inline |
Definition at line 279 of file mapDistributeBase.H.
References mapDistributeBase::constructSize_.
|
inline |
Definition at line 285 of file mapDistributeBase.H.
References mapDistributeBase::subMap_.
Referenced by AMIInterpolation::agglomerate(), mappedPatchFieldBase< scalar >::distribute(), refinementHistory::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), extendedCellToFaceStencil::writeStencilStats(), and streamLineBase::writeToFile().
|
inline |
Definition at line 291 of file mapDistributeBase.H.
References mapDistributeBase::subMap_.
|
inline |
Definition at line 297 of file mapDistributeBase.H.
References mapDistributeBase::constructMap_.
Referenced by AMIInterpolation::agglomerate(), mappedPatchFieldBase< scalar >::distribute(), refinementHistory::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), and streamLineBase::writeToFile().
|
inline |
Definition at line 303 of file mapDistributeBase.H.
References mapDistributeBase::constructMap_.
|
inline |
Definition at line 309 of file mapDistributeBase.H.
References mapDistributeBase::subHasFlip_.
Referenced by distributedTriSurfaceMesh::findNearest(), and distributedTriSurfaceMesh::getVolumeType().
|
inline |
Definition at line 315 of file mapDistributeBase.H.
References mapDistributeBase::subHasFlip_.
|
inline |
Definition at line 321 of file mapDistributeBase.H.
References mapDistributeBase::constructHasFlip_.
Referenced by distributedTriSurfaceMesh::findNearest(), and distributedTriSurfaceMesh::getVolumeType().
|
inline |
Definition at line 327 of file mapDistributeBase.H.
References mapDistributeBase::constructHasFlip_.
|
inline |
Definition at line 332 of file mapDistributeBase.H.
References mapDistributeBase::comm_.
Referenced by distributedTriSurfaceMesh::findNearest(), and distributedTriSurfaceMesh::getVolumeType().
|
static |
Definition at line 39 of file mapDistributeBase.C.
References forAll, HashSet::insert(), and List::setSize().
Referenced by streamLineBase::writeToFile().
const Foam::List< Foam::labelPair > & schedule | ( | ) | const |
Definition at line 180 of file mapDistributeBase.C.
References mapDistributeBase::comm_, mapDistributeBase::constructMap_, UPstream::msgType(), mapDistributeBase::schedulePtr_, and mapDistributeBase::subMap_.
void transfer | ( | mapDistributeBase & | rhs | ) |
Definition at line 876 of file mapDistributeBase.C.
References mapDistributeBase::comm_, mapDistributeBase::constructHasFlip_, mapDistributeBase::constructMap_, mapDistributeBase::constructSize_, mapDistributeBase::subHasFlip_, and mapDistributeBase::subMap_.
Referenced by mapDistributeBase::mapDistributeBase(), and mapDistribute::transfer().
|
static |
Definition at line 899 of file mapDistributeBase.C.
References globalIndex::isLocal(), globalIndex::toLocal(), and globalIndex::whichProcID().
void compact | ( | const boolList & | elemIsUsed, |
const int | tag = UPstream::msgType() |
||
) |
Definition at line 923 of file mapDistributeBase.C.
References UPstream::allProcs(), forAll, Foam::mag(), Foam::max(), UPstream::myProcNo(), UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), UPstream::parRun(), UIPstream::read(), List::setSize(), UPstream::waitRequests(), and UOPstream::write().
void compact | ( | const boolList & | elemIsUsed, |
const label | localSize, | ||
labelList & | oldToNewSub, | ||
labelList & | oldToNewConstruct, | ||
const int | tag = UPstream::msgType() |
||
) |
Definition at line 1092 of file mapDistributeBase.C.
References UPstream::allProcs(), forAll, Foam::mag(), UPstream::myProcNo(), UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), UPstream::parRun(), UIPstream::read(), List::setSize(), Foam::sign(), UPstream::waitRequests(), and UOPstream::write().
|
static |
Definition at line 115 of file mapDistributeBaseTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, field(), PstreamBuffers::finishedSends(), forAll, Foam::blockMeshTools::read(), List::setSize(), and Foam::vtk::write().
Referenced by Field< Foam::Vector2D >::autoMap(), faceAreaWeightAMI::calculate(), mapDistribute::distribute(), mappedPatchBase::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), mappedPatchBase::reverseDistribute(), and streamLineBase::writeToFile().
|
static |
Definition at line 647 of file mapDistributeBaseTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, field(), PstreamBuffers::finishedSends(), forAll, Foam::blockMeshTools::read(), List::setSize(), and Foam::vtk::write().
void distribute | ( | List< T > & | fld, |
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 1311 of file mapDistributeBaseTemplates.C.
References fld.
void distribute | ( | List< T > & | fld, |
const negateOp & | negOp, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 1246 of file mapDistributeBaseTemplates.C.
References UPstream::blocking, UPstream::defaultCommsType, fld, UPstream::nonBlocking, and UPstream::scheduled.
void distribute | ( | DynamicList< T > & | fld, |
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 1325 of file mapDistributeBaseTemplates.C.
References fld.
void reverseDistribute | ( | const label | constructSize, |
List< T > & | fld, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 1345 of file mapDistributeBaseTemplates.C.
References UPstream::blocking, UPstream::defaultCommsType, fld, UPstream::nonBlocking, and UPstream::scheduled.
Referenced by mapDistribute::reverseDistribute().
void reverseDistribute | ( | const label | constructSize, |
const T & | nullValue, | ||
List< T > & | fld, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 1413 of file mapDistributeBaseTemplates.C.
References UPstream::blocking, UPstream::defaultCommsType, fld, UPstream::nonBlocking, and UPstream::scheduled.
void send | ( | PstreamBuffers & | pBufs, |
const List< T > & | field | ||
) | const |
Definition at line 1169 of file mapDistributeBaseTemplates.C.
References mapDistributeBase::accessAndFlip(), UPstream::allProcs(), mapDistributeBase::comm_, field(), PstreamBuffers::finishedSends(), forAll, mapDistributeBase::subHasFlip_, and mapDistributeBase::subMap_.
void receive | ( | PstreamBuffers & | pBufs, |
List< T > & | field | ||
) | const |
Definition at line 1203 of file mapDistributeBaseTemplates.C.
References Foam::abort(), UPstream::allProcs(), Foam::FatalError, FatalErrorInFunction, and field().
void printLayout | ( | Ostream & | os | ) | const |
Definition at line 214 of file mapDistributeBase.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::labelMax, Foam::labelMin, Foam::mag(), Foam::max(), Foam::min(), UPstream::myProcNo(), UPstream::nProcs(), and os().
Referenced by mapDistribute::printLayout().
|
inline |
Definition at line 482 of file mapDistributeBase.H.
References NotImplemented.
void operator= | ( | const mapDistributeBase & | rhs | ) |
Definition at line 1320 of file mapDistributeBase.C.
References mapDistributeBase::comm_, mapDistributeBase::constructHasFlip_, mapDistributeBase::constructMap_, mapDistributeBase::constructSize_, mapDistributeBase::subHasFlip_, and mapDistributeBase::subMap_.
Referenced by mapDistribute::operator=().
void operator= | ( | mapDistributeBase && | rhs | ) |
Definition at line 1337 of file mapDistributeBase.C.
|
friend |
|
friend |
|
protected |
Definition at line 106 of file mapDistributeBase.H.
Referenced by mapDistributeBase::constructSize(), Foam::operator<<(), mapDistributeBase::operator=(), Foam::operator>>(), and mapDistributeBase::transfer().
|
protected |
Definition at line 109 of file mapDistributeBase.H.
Referenced by Foam::operator<<(), mapDistributeBase::operator=(), Foam::operator>>(), mapDistributeBase::schedule(), mapDistributeBase::send(), mapDistributeBase::subMap(), and mapDistributeBase::transfer().
|
protected |
Definition at line 112 of file mapDistributeBase.H.
Referenced by mapDistributeBase::constructMap(), Foam::operator<<(), mapDistributeBase::operator=(), Foam::operator>>(), mapDistributeBase::schedule(), and mapDistributeBase::transfer().
|
protected |
Definition at line 115 of file mapDistributeBase.H.
Referenced by Foam::operator<<(), mapDistributeBase::operator=(), Foam::operator>>(), mapDistributeBase::send(), mapDistributeBase::subHasFlip(), and mapDistributeBase::transfer().
|
protected |
Definition at line 118 of file mapDistributeBase.H.
Referenced by mapDistributeBase::constructHasFlip(), Foam::operator<<(), mapDistributeBase::operator=(), Foam::operator>>(), and mapDistributeBase::transfer().
|
protected |
Definition at line 121 of file mapDistributeBase.H.
Referenced by mapDistributeBase::comm(), Foam::operator<<(), mapDistributeBase::operator=(), Foam::operator>>(), mapDistributeBase::schedule(), mapDistributeBase::send(), and mapDistributeBase::transfer().
Definition at line 124 of file mapDistributeBase.H.
Referenced by mapDistributeBase::schedule().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.