Class containing processor-to-processor mapping information. More...
Classes | |
class | transform |
class | transformPosition |
Public Member Functions | |
ClassName ("mapDistribute") | |
mapDistribute (const label comm=UPstream::worldComm) | |
mapDistribute (const mapDistribute &map) | |
mapDistribute (mapDistribute &&map) | |
mapDistribute (const label constructSize, labelListList &&subMap, labelListList &&constructMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
mapDistribute (const label constructSize, labelListList &&subMap, labelListList &&constructMap, labelListList &&transformElements, labelList &&transformStart, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
mapDistribute (const labelUList &sendProcs, const labelUList &recvProcs, const label comm=UPstream::worldComm) | |
mapDistribute (const globalIndex &, labelList &elements, List< Map< label >> &compactMap, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm) | |
mapDistribute (const globalIndex &, labelListList &cellCells, List< Map< label >> &compactMap, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm) | |
mapDistribute (const globalIndex &, labelList &untransformedElements, const globalIndexAndTransform &, const labelPairList &transformedElements, labelList &transformedIndices, List< Map< label >> &compactMap, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm) | |
mapDistribute (const globalIndex &, labelListList &cellCells, const globalIndexAndTransform &, const List< labelPairList > &transformedElements, labelListList &transformedIndices, List< Map< label >> &compactMap, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm) | |
mapDistribute (labelListList &&subMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
mapDistribute (Istream &is) | |
autoPtr< mapDistribute > | clone () const |
virtual | ~mapDistribute ()=default |
const labelListList & | transformElements () const |
const labelList & | transformStart () const |
label | whichTransform (const label index) const |
void | transfer (mapDistribute &map) |
template<class T > | |
void | distribute (List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const |
template<class T , class negateOp > | |
void | distribute (List< T > &fld, const negateOp &negOp, const bool dummyTransform=true, const int tag=UPstream::msgType()) const |
template<class T > | |
void | distribute (DynamicList< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const label constructSize, List< T > &, const bool dummyTransform=true, const int tag=UPstream::msgType()) const |
template<class T > | |
void | reverseDistribute (const label constructSize, const T &nullValue, List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const |
template<class T , class TransformOp > | |
void | distribute (const globalIndexAndTransform &, List< T > &fld, const TransformOp &top, const int tag=UPstream::msgType()) const |
template<class T , class TransformOp > | |
void | reverseDistribute (const globalIndexAndTransform &, const label constructSize, List< T > &fld, const TransformOp &top, const int tag=UPstream::msgType()) const |
template<class T , class TransformOp > | |
void | reverseDistribute (const globalIndexAndTransform &, const label constructSize, const T &nullValue, List< T > &fld, const TransformOp &top, const int tag=UPstream::msgType()) const |
void | printLayout (Ostream &os) const |
void | updateMesh (const mapPolyMesh &) |
void | operator= (const mapDistribute &rhs) |
void | operator= (mapDistribute &&rhs) |
![]() | |
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) |
Friends | |
Istream & | operator>> (Istream &, mapDistribute &) |
Ostream & | operator<< (Ostream &, const mapDistribute &) |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
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 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) |
![]() | |
label | constructSize_ |
labelListList | subMap_ |
labelListList | constructMap_ |
bool | subHasFlip_ |
bool | constructHasFlip_ |
label | comm_ |
autoPtr< List< labelPair > > | schedulePtr_ |
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.
It rewrites the input global indices into indices into the constructed data.
Any distribute with transforms is now done as: 1. exchange data with other processors and receive these into the slots for that processor 2. for all transformations transform a subset of the data according to transformElements_[transformI] and store this starting from transformStart_[transformI]
In the same way a reverse distribute will 1. apply the inverse transform to the data starting at transformStart_[transformI] and copy the result back into the transformElements_[transformI]. These might be local or remote slots. 2. the data in the remote slots will now be sent back to the correct location in the originating processor.
E.g. a map to handle
on e.g. processor 1 out of 2:
+——+ <- transformStart[2] | | | | <- transform2 applied to data in local or remote slots | | +——+ <- transformStart[1] | | | | <- transform1 applied to data in local or remote slots | | +——+ <- transformStart[1] | | | | <- transform0 applied to data in local or remote slots | | +——+ <- transformStart[0] | | | | <- data from proc2 | | +——+ | | | | <- data from proc0 | | +——+ <- mesh.nPoints() | | | | | | +——+ 0
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 159 of file mapDistribute.H.
mapDistribute | ( | const label | comm = UPstream::worldComm | ) |
Definition at line 144 of file mapDistribute.C.
|
explicit |
Definition at line 150 of file mapDistribute.C.
|
explicit |
Definition at line 158 of file mapDistribute.C.
References mapDistribute::transfer().
mapDistribute | ( | const label | constructSize, |
labelListList && | subMap, | ||
labelListList && | constructMap, | ||
const bool | subHasFlip = false , |
||
const bool | constructHasFlip = false , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 167 of file mapDistribute.C.
mapDistribute | ( | const label | constructSize, |
labelListList && | subMap, | ||
labelListList && | constructMap, | ||
labelListList && | transformElements, | ||
labelList && | transformStart, | ||
const bool | subHasFlip = false , |
||
const bool | constructHasFlip = false , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 189 of file mapDistribute.C.
mapDistribute | ( | const labelUList & | sendProcs, |
const labelUList & | recvProcs, | ||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 215 of file mapDistribute.C.
mapDistribute | ( | const globalIndex & | globalNumbering, |
labelList & | elements, | ||
List< Map< label >> & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 226 of file mapDistribute.C.
mapDistribute | ( | const globalIndex & | globalNumbering, |
labelListList & | cellCells, | ||
List< Map< label >> & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 246 of file mapDistribute.C.
mapDistribute | ( | const globalIndex & | globalNumbering, |
labelList & | untransformedElements, | ||
const globalIndexAndTransform & | globalTransforms, | ||
const labelPairList & | transformedElements, | ||
labelList & | transformedIndices, | ||
List< Map< label >> & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 266 of file mapDistribute.C.
References Foam::expressions::patchExpr::debug, forAll, globalIndexAndTransform::index(), UPstream::myProcNo(), n, Foam::Pout, globalIndexAndTransform::processor(), List::setSize(), globalIndexAndTransform::transformIndex(), globalIndexAndTransform::transformPermutations(), and Foam::Zero.
mapDistribute | ( | const globalIndex & | globalNumbering, |
labelListList & | cellCells, | ||
const globalIndexAndTransform & | globalTransforms, | ||
const List< labelPairList > & | transformedElements, | ||
labelListList & | transformedIndices, | ||
List< Map< label >> & | compactMap, | ||
const int | tag = Pstream::msgType() , |
||
const label | comm = UPstream::worldComm |
||
) |
Definition at line 374 of file mapDistribute.C.
References Foam::expressions::patchExpr::debug, forAll, globalIndexAndTransform::index(), UPstream::myProcNo(), n, Foam::Pout, globalIndexAndTransform::processor(), List::setSize(), globalIndexAndTransform::transformIndex(), globalIndexAndTransform::transformPermutations(), and Foam::Zero.
|
explicit |
Definition at line 495 of file mapDistribute.C.
|
explicit |
Definition at line 506 of file mapDistribute.C.
|
virtualdefault |
ClassName | ( | "mapDistribute" | ) |
Foam::autoPtr< Foam::mapDistribute > clone | ( | ) | const |
Definition at line 512 of file mapDistribute.C.
References autoPtr::New().
|
inline |
Definition at line 455 of file mapDistribute.H.
|
inline |
Definition at line 461 of file mapDistribute.H.
Foam::label whichTransform | ( | const label | index | ) | const |
Definition at line 520 of file mapDistribute.C.
References Foam::findLower().
void transfer | ( | mapDistribute & | map | ) |
Definition at line 526 of file mapDistribute.C.
References mapDistributeBase::transfer().
Referenced by IOmapDistribute::IOmapDistribute(), and mapDistribute::mapDistribute().
void distribute | ( | List< T > & | fld, |
const bool | dummyTransform = true , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 147 of file mapDistributeTemplates.C.
References fld.
Referenced by AMIInterpolation::agglomerate(), extendedFaceToCellStencil::collectData(), extendedCellToFaceStencil::collectData(), hexRef8Data::distribute(), mappedPatchBase::distribute(), mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributeFaceData(), mapDistributeLagrangian::distributeLagrangianData(), mapDistributePolyMesh::distributePatchData(), mapDistributePolyMesh::distributePointData(), cellVolumeWeight::findHoles(), inverseDistance::findHoles(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), globalIndexAndTransform::globalIndexAndTransform(), AMIInterpolation::interpolateToSource(), AMIInterpolation::interpolateToTarget(), distributedTriSurfaceMesh::localQueries(), meshToMesh::mapSrcToTgt(), meshToMesh::mapTgtToSrc(), globalMeshData::mergePoints(), semiPermeableBaffleMassFractionFvPatchScalarField::phiY(), PatchTools::pointNormals(), sampledPatchInternalField::sampleOnPoints(), globalMeshData::syncData(), pointConstraints::syncUntransformedData(), thermalBaffle1DFvPatchScalarField< solidType >::updateCoeffs(), Sampled< Type >::value(), and dynamicOversetFvMesh::writeObject().
void distribute | ( | List< T > & | fld, |
const negateOp & | negOp, | ||
const bool | dummyTransform = true , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 125 of file mapDistributeTemplates.C.
References mapDistributeBase::distribute(), and fld.
void distribute | ( | DynamicList< T > & | fld, |
const bool | dummyTransform = true , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 159 of file mapDistributeTemplates.C.
References fld.
void reverseDistribute | ( | const label | constructSize, |
List< T > & | fld, | ||
const bool | dummyTransform = true , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 177 of file mapDistributeTemplates.C.
References fld, and mapDistributeBase::reverseDistribute().
Referenced by distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getField(), distributedTriSurfaceMesh::getNormal(), distributedTriSurfaceMesh::getRegion(), mappedPatchFieldBase< scalar >::mappedField(), globalMeshData::mergePoints(), PatchTools::pointNormals(), sampledPatchInternalField::sampleOnPoints(), globalMeshData::syncData(), pointConstraints::syncUntransformedData(), and Sampled< Type >::value().
void reverseDistribute | ( | const label | constructSize, |
const T & | nullValue, | ||
List< T > & | fld, | ||
const bool | dummyTransform = true , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 195 of file mapDistributeTemplates.C.
References fld, and mapDistributeBase::reverseDistribute().
void distribute | ( | const globalIndexAndTransform & | git, |
List< T > & | fld, | ||
const TransformOp & | top, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 214 of file mapDistributeTemplates.C.
References fld.
void reverseDistribute | ( | const globalIndexAndTransform & | git, |
const label | constructSize, | ||
List< T > & | fld, | ||
const TransformOp & | top, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 230 of file mapDistributeTemplates.C.
References fld.
void reverseDistribute | ( | const globalIndexAndTransform & | git, |
const label | constructSize, | ||
const T & | nullValue, | ||
List< T > & | fld, | ||
const TransformOp & | top, | ||
const int | tag = UPstream::msgType() |
||
) | const |
Definition at line 250 of file mapDistributeTemplates.C.
References fld.
void printLayout | ( | Ostream & | os | ) | const |
Definition at line 126 of file mapDistribute.C.
References Foam::endl(), forAll, os(), and mapDistributeBase::printLayout().
|
inline |
Definition at line 564 of file mapDistribute.H.
References NotImplemented.
void operator= | ( | const mapDistribute & | rhs | ) |
Definition at line 541 of file mapDistribute.C.
References mapDistributeBase::operator=().
Referenced by IOmapDistribute::IOmapDistribute().
void operator= | ( | mapDistribute && | rhs | ) |
Definition at line 554 of file mapDistribute.C.
|
friend |
|
friend |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.