Calculates a unique integer (label so might not have enough room - 2G max) for processor + local index. E.g. More...
Classes | |
class | const_iterator |
Public Types | |
enum | accessType : char { OFFSETS, SIZES } |
Public Member Functions | |
globalIndex ()=default | |
globalIndex (const labelUList &listOffsets) | |
globalIndex (labelList &&listOffsets) | |
globalIndex (const labelUList &offsetsOrSizes, enum accessType accType) | |
globalIndex (const label localSize) | |
globalIndex (const label localSize, const int tag, const label comm, const bool parallel) | |
globalIndex (Istream &is) | |
bool | empty () const |
label | size () const |
labelList | sizes () const |
const labelUList | localStarts () const |
label | maxSize () const |
const labelList & | offsets () const noexcept |
label | nProcs () const noexcept |
labelRange | allProcs () const noexcept |
labelRange | subProcs () const noexcept |
labelList & | offsets () noexcept |
void | reset (const label localSize) |
void | reset (const label localSize, const int tag, const label comm, const bool parallel) |
void | reset (const labelUList &sizes, const bool checkOverflow=false) |
void | setLocalSize (const label proci, const label len) |
label | localStart () const |
label | localSize () const |
label | maxNonLocalSize () const |
labelRange | range () const |
List< labelRange > | ranges () const |
bool | isLocal (const label i) const |
label | toGlobal (const label i) const |
labelList | toGlobal (const labelUList &labels) const |
void | inplaceToGlobal (labelList &labels) const |
label | toLocal (const label i) const |
label | offset (const label proci) const |
label | localStart (const label proci) const |
label | localSize (const label proci) const |
label | maxNonLocalSize (const label proci) const |
labelRange | range (const label proci) const |
bool | isLocal (const label proci, const label i) const |
label | toGlobal (const label proci, const label i) const |
labelList | toGlobal (const label proci, const labelUList &labels) const |
void | inplaceToGlobal (const label proci, labelList &labels) const |
label | toLocal (const label proci, const label i) const |
label | whichProcID (const label i) const |
const_iterator | cbegin () const noexcept |
const const_iterator | cend () const noexcept |
const_iterator | begin () const noexcept |
const const_iterator | end () const noexcept |
template<class ProcIDsContainer , class Type > | |
void | gather (const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking) const |
template<class Type > | |
void | gather (const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
template<class Type , class Addr > | |
void | gather (const IndirectListBase< Type, Addr > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::scheduled, const label comm=UPstream::worldComm) const |
template<class ProcIDsContainer , class Type > | |
void | gather (const label comm, const ProcIDsContainer &procIDs, List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking) const |
template<class Type > | |
void | gather (List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
template<class Type , class OutputContainer = List<Type>> | |
void | mpiGather (const UList< Type > &sendData, OutputContainer &allValues, const label comm=UPstream::worldComm) const |
template<class Type , class OutputContainer = List<Type>> | |
OutputContainer | mpiGather (const UList< Type > &sendData, const label comm=UPstream::worldComm) const |
template<class ProcIDsContainer , class Type > | |
void | scatter (const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking) const |
template<class Type > | |
void | scatter (const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
template<class Type , class CombineOp > | |
void | get (List< Type > &allFld, const labelUList &globalIds, const CombineOp &cop, const label comm=UPstream::worldComm, const int tag=UPstream::msgType()) const |
template<class SubListType > | |
Foam::labelList | calcListOffsets (const List< SubListType > &lists, const bool checkOverflow) |
Static Public Member Functions | |
static labelList | calcOffsets (const labelUList &localSizes, const bool checkOverflow=false) |
template<class SubListType > | |
static labelList | calcListOffsets (const List< SubListType > &lists, const bool checkOverflow=false) |
static List< labelRange > | calcRanges (const labelUList &localSizes, const bool checkOverflow=false) |
template<class ProcIDsContainer , class Type > | |
static void | gather (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking) |
template<class Type , class Addr > | |
static void | gather (const labelUList &offsets, const label comm, const UList< int > &procIDs, const IndirectListBase< Type, Addr > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::scheduled) |
template<class ProcIDsContainer , class Type > | |
static void | gather (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking) |
template<class Type > | |
static void | gatherOp (const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking) |
template<class Type > | |
static void | gatherOp (List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking) |
template<class ProcIDsContainer , class Type > | |
static void | scatter (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking) |
Friends | |
Istream & | operator>> (Istream &is, globalIndex &gi) |
Ostream & | operator<< (Ostream &os, const globalIndex &gi) |
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local index. E.g.
globalIndex globalFaces(mesh.nFaces()); label globalFacei = globalFaces.toGlobal(facei);
Definition at line 64 of file globalIndex.H.
enum accessType : char |
Enumerator | |
---|---|
OFFSETS | |
SIZES |
Definition at line 89 of file globalIndex.H.
|
default |
|
inlineexplicit |
Definition at line 28 of file globalIndexI.H.
References UList::size().
|
inlineexplicit |
Definition at line 40 of file globalIndexI.H.
References UList::size().
|
inline |
Definition at line 56 of file globalIndexI.H.
References reset(), and UList::size().
|
inlineexplicit |
Definition at line 73 of file globalIndexI.H.
References globalIndex::localSize(), and globalIndex::reset().
|
inline |
tag | message tag |
comm | communicator |
parallel | use parallel comms |
Definition at line 80 of file globalIndexI.H.
References reset().
|
explicit |
Definition at line 104 of file globalIndex.C.
|
inline |
Definition at line 93 of file globalIndexI.H.
|
inline |
Definition at line 144 of file globalIndexI.H.
Referenced by nearWallFields::calcAddressing(), simpleGeomDecomp::decompose(), metisLikeDecomp::decomposeGeneral(), distributedTriSurfaceMesh::globalSize(), globalIndex::mpiGather(), regionSplit::nRegions(), SprayCloud::penetration(), fileWriter::writeProcIDs(), and streamLineBase::writeToFile().
Foam::labelList sizes | ( | ) | const |
Definition at line 258 of file globalIndex.C.
References List::resize(), and Foam::HashTableOps::values().
Referenced by PatchTools::gatherAndMerge().
|
inline |
Definition at line 134 of file globalIndexI.H.
References UList::null().
|
inline |
Definition at line 186 of file globalIndexI.H.
Referenced by Foam::ensightOutput::writeCloudPositions(), and Foam::ensightOutput::Detail::writeFieldContent().
|
inlinenoexcept |
Definition at line 122 of file globalIndexI.H.
|
inlinenoexcept |
Definition at line 99 of file globalIndexI.H.
Referenced by globalIndex::mpiGather().
|
inlinenoexcept |
Definition at line 106 of file globalIndexI.H.
|
inlinenoexcept |
Definition at line 114 of file globalIndexI.H.
Referenced by Foam::ensightOutput::writeCloudField(), Foam::ensightOutput::writeCloudPositions(), Foam::ensightOutput::Detail::writeFieldContent(), Foam::vtk::writeListParallel(), and Foam::vtk::writeListsParallel().
|
inlinenoexcept |
|
inline |
Definition at line 150 of file globalIndexI.H.
References UPstream::msgType(), reset(), and UPstream::worldComm.
Referenced by globalMeshData::globalEdgeNumbering(), globalIndex::globalIndex(), globalMeshData::globalPointNumbering(), distributedTriSurfaceMesh::globalTris(), Foam::ensightOutput::writeCloudField(), and Foam::ensightOutput::Detail::writeFieldContent().
void reset | ( | const label | localSize, |
const int | tag, | ||
const label | comm, | ||
const bool | parallel | ||
) |
tag | message tag |
comm | communicator |
parallel | use parallel comms |
Definition at line 173 of file globalIndex.C.
References Pstream::gatherList(), UPstream::myProcNo(), UPstream::nProcs(), reset(), Pstream::scatterList(), and Foam::Zero.
void reset | ( | const labelUList & | sizes, |
const bool | checkOverflow = false |
||
) |
Definition at line 204 of file globalIndex.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::labelMax, Foam::nl, and UList::size().
void setLocalSize | ( | const label | proci, |
const label | len | ||
) |
Definition at line 240 of file globalIndex.C.
References delta.
|
inline |
Definition at line 168 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by viewFactor::calculate(), meshRefinement::getMasterEdges(), GAMGProcAgglomeration::globalCellCells(), cellCellStencil::globalCellCells(), lduPrimitiveMesh::globalCellCells(), globalIndex::mpiGather(), Foam::vtk::writeCellSetFaces(), Foam::vtk::writeFaceSet(), patchMeshWriter::writeGeometry(), internalMeshWriter::writeGeometry(), polyWriter::writeLineGeometry(), internalMeshWriter::writePointIDs(), polyWriter::writePolyGeometry(), and patchMeshWriter::writePolys().
|
inline |
Definition at line 180 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by createShellMesh::calcPointRegions(), viewFactor::calculate(), simpleGeomDecomp::decompose(), metisLikeDecomp::decomposeGeneral(), mapDistributeBase::exchangeAddressing(), meshRefinement::getMasterEdges(), GAMGProcAgglomeration::globalCellCells(), cellCellStencil::globalCellCells(), globalIndex::globalIndex(), globalIndex::mpiGather(), regionSplit::nLocalRegions(), SprayCloud::penetration(), Foam::ensightOutput::writeCloudField(), Foam::ensightOutput::writeCloudPositions(), Foam::ensightOutput::Detail::writeFieldContent(), Foam::vtk::writeListParallel(), Foam::vtk::writeListsParallel(), fileWriter::writeProcIDs(), and streamLineBase::writeToFile().
|
inline |
Definition at line 193 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by Foam::ensightOutput::writeCloudField(), Foam::vtk::writeListParallel(), and Foam::vtk::writeListsParallel().
|
inline |
Definition at line 205 of file globalIndexI.H.
References UPstream::myProcNo(), and range.
Foam::List< Foam::labelRange > ranges | ( | ) | const |
Definition at line 281 of file globalIndex.C.
References List::resize(), and Foam::HashTableOps::values().
|
inline |
Definition at line 217 of file globalIndexI.H.
References globalIndex::isLocal(), and UPstream::myProcNo().
Referenced by decompositionMethod::calcCellCells(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), refinementParameters::findCells(), fluxSummary::initialiseCellZoneAndDirection(), globalIndex::isLocal(), regionSplit2D::regionSplit2D(), and mapDistributeBase::renumber().
|
inline |
Definition at line 233 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by nearWallFields::calcAddressing(), decompositionMethod::calcCellCells(), createShellMesh::calcPointRegions(), viewFactor::calculate(), refinementParameters::findCells(), meshRefinement::getMasterEdges(), cellCellStencil::globalCellCells(), addPatchCellLayer::globalEdgeFaces(), fluxSummary::initialiseCellZoneAndDirection(), viewFactor::insertMatrixElements(), inverseDistance::markDonors(), globalMeshData::mergePoints(), MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration(), regionSplit2D::regionSplit2D(), zoltanRenumber::renumber(), structuredRenumber::renumber(), faMeshBoundaryHalo::reset(), addPatchCellLayer::setRefinement(), cellVolumeWeight::update(), and dynamicOversetFvMesh::updateAddressing().
|
inline |
Definition at line 253 of file globalIndexI.H.
References UPstream::myProcNo().
|
inline |
Definition at line 276 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by faceAreaWeightAMI2D::calculate(), faceAreaWeightAMI::calculate(), and cyclicAMIPolyPatch::setAMIFaces().
|
inline |
Definition at line 298 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by fvMeshPrimitiveLduAddressing::addAddressing(), decompositionMethod::calcCellCells(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), refinementParameters::findCells(), fluxSummary::initialiseCellZoneAndDirection(), distributedTriSurfaceMesh::localQueries(), mapDistributeBase::renumber(), and dynamicOversetFvMesh::updateAddressing().
|
inline |
Definition at line 156 of file globalIndexI.H.
Referenced by simpleGeomDecomp::decompose(), metisLikeDecomp::decomposeGeneral(), SprayCloud::penetration(), and Foam::vtk::writeListParallel().
|
inline |
Definition at line 162 of file globalIndexI.H.
|
inline |
Definition at line 174 of file globalIndexI.H.
Foam::label maxNonLocalSize | ( | const label | proci | ) | const |
Definition at line 307 of file globalIndex.C.
References Foam::max().
|
inline |
Definition at line 199 of file globalIndexI.H.
|
inline |
Definition at line 211 of file globalIndexI.H.
|
inline |
Definition at line 224 of file globalIndexI.H.
|
inline |
Definition at line 240 of file globalIndexI.H.
|
inline |
Definition at line 262 of file globalIndexI.H.
|
inline |
Definition at line 283 of file globalIndexI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
|
inline |
Definition at line 304 of file globalIndexI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::findLower().
Referenced by fvMeshPrimitiveLduAddressing::addAddressing(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), refinementParameters::findCells(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::localQueries(), mapDistributeBase::renumber(), and dynamicOversetFvMesh::updateAddressing().
|
inlinenoexcept |
Definition at line 430 of file globalIndexI.H.
|
inlinenoexcept |
Definition at line 437 of file globalIndexI.H.
|
inlinenoexcept |
Definition at line 444 of file globalIndexI.H.
|
inlinenoexcept |
Definition at line 451 of file globalIndexI.H.
|
static |
Definition at line 29 of file globalIndex.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::labelMax, Foam::nl, List::resize(), UList::size(), and Foam::HashTableOps::values().
|
static |
|
static |
Definition at line 67 of file globalIndex.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::labelMax, Foam::nl, List::resize(), UList::size(), and Foam::HashTableOps::values().
|
static |
comm | communicator |
Definition at line 68 of file globalIndexTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, UList::last(), Foam::blockMeshTools::read(), List::resize_nocopy(), and Foam::vtk::write().
Referenced by globalIndex::gather(), PatchTools::gatherAndMerge(), globalIndex::gatherOp(), and GAMGAgglomeration::procAgglomerateRestrictAddressing().
|
static |
comm | communicator |
Definition at line 223 of file globalIndexTemplates.C.
References Foam::exit(), Foam::FatalError, fld, UList::last(), List::resize_nocopy(), UList::size(), and WarningInFunction.
|
inline |
comm | communicator |
Definition at line 409 of file globalIndex.H.
References fld, and globalIndex::gather().
void gather | ( | const UList< Type > & | fld, |
List< Type > & | allFld, | ||
const int | tag = UPstream::msgType() , |
||
const Pstream::commsTypes | commsType = Pstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
void gather | ( | const IndirectListBase< Type, Addr > & | fld, |
List< Type > & | allFld, | ||
const int | tag = UPstream::msgType() , |
||
const Pstream::commsTypes | commsType = Pstream::commsTypes::scheduled , |
||
const label | comm = UPstream::worldComm |
||
) | const |
|
static |
|
inline |
comm | communicator |
Definition at line 463 of file globalIndex.H.
References fld, and globalIndex::gather().
void gather | ( | List< Type > & | fld, |
const int | tag = UPstream::msgType() , |
||
const Pstream::commsTypes | commsType = Pstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
void mpiGather | ( | const UList< Type > & | sendData, |
OutputContainer & | allValues, | ||
const label | comm = UPstream::worldComm |
||
) | const |
comm | communicator |
Definition at line 386 of file globalIndexTemplates.C.
References Foam::abort(), UList::cdata_bytes(), Foam::FatalError, FatalErrorInFunction, globalIndex::localSize(), globalIndex::localStart(), Foam::nl, globalIndex::nProcs(), List::resize(), List::resize_nocopy(), globalIndex::size(), and UList::size_bytes().
OutputContainer mpiGather | ( | const UList< Type > & | sendData, |
const label | comm = UPstream::worldComm |
||
) | const |
comm | communicator |
Definition at line 452 of file globalIndexTemplates.C.
|
static |
Definition at line 465 of file globalIndexTemplates.C.
References fld, and globalIndex::gather().
Referenced by sampledSet::gather(), mergedSurf::merge(), and surfaceWriter::mergeFieldTemplate().
|
static |
Definition at line 478 of file globalIndexTemplates.C.
References fld, and globalIndex::gather().
|
static |
comm | communicator |
Definition at line 490 of file globalIndexTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, Foam::blockMeshTools::read(), and Foam::vtk::write().
Referenced by globalIndex::scatter().
|
inline |
comm | communicator |
Definition at line 550 of file globalIndex.H.
References fld, and globalIndex::scatter().
void scatter | ( | const UList< Type > & | allFld, |
UList< Type > & | fld, | ||
const int | tag = UPstream::msgType() , |
||
const Pstream::commsTypes | commsType = Pstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
void get | ( | List< Type > & | allFld, |
const labelUList & | globalIds, | ||
const CombineOp & | cop, | ||
const label | comm = UPstream::worldComm , |
||
const int | tag = UPstream::msgType() |
||
) | const |
comm | communicator |
Definition at line 665 of file globalIndexTemplates.C.
References PstreamBuffers::finishedSends(), fld, forAll, CompactListList::offsets(), os(), List::resize_nocopy(), and UList::size().
Foam::labelList calcListOffsets | ( | const List< SubListType > & | lists, |
const bool | checkOverflow | ||
) |
Definition at line 29 of file globalIndexTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::labelMax, Foam::nl, List::resize(), and Foam::HashTableOps::values().
|
friend |
|
friend |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.