Loading...
Searching...
No Matches
mapDistributeBase Class Reference

Class containing processor-to-processor mapping information. More...

#include <mapDistributeBase.H>

Inheritance diagram for mapDistributeBase:

Public Types

enum class  layoutTypes : char { linear , localFirst }
 The map layout (eg, of the constructMap). More...

Public Member Functions

 ClassName ("mapDistributeBase")
 mapDistributeBase () noexcept
 Default construct (uses worldComm).
 mapDistributeBase (const label comm) noexcept
 Default construct with specified communicator.
 mapDistributeBase (const mapDistributeBase &map)
 Copy construct.
 mapDistributeBase (mapDistributeBase &&map)
 Move construct.
 mapDistributeBase (const dictionary &dict, const label comm=UPstream::worldComm)
 Read construct from dictionary.
 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.
 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.
 mapDistributeBase (const globalIndex &, labelList &elements, List< Map< label > > &compactMap, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
 Construct from list of (possibly) remote elements in globalIndex numbering (or -1).
 mapDistributeBase (const globalIndex &, labelListList &cellCells, List< Map< label > > &compactMap, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
 Special variant that works with the info sorted into bins according to local indices.
 mapDistributeBase (const layoutTypes constructLayout, labelListList &&subMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm)
 Construct from my elements to send, targetting the specified constructMap layout.
 mapDistributeBase (labelListList &&subMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm)
 Construct from my elements to send.
 mapDistributeBase (const UPtrList< const mapDistributeBase > &maps, const labelList &localRanks, const label newComm, const labelListList &newToOldRanks, labelList &startOfLocal, List< Map< label > > &compactMaps)
 Construct from multiple maps and processor collation.
 mapDistributeBase (Istream &is)
 Construct from Istream.
label constructSize () const noexcept
 Constructed data size.
label & constructSize () noexcept
 Constructed data size.
const labelListListsubMap () const noexcept
 From subsetted data back to original data.
labelListListsubMap () noexcept
 From subsetted data back to original data.
const labelListListconstructMap () const noexcept
 From subsetted data to new reconstructed data.
labelListListconstructMap () noexcept
 From subsetted data to new reconstructed data.
bool subHasFlip () const noexcept
 Does subMap include a sign.
bool & subHasFlip () noexcept
 Does subMap include a sign.
bool constructHasFlip () const noexcept
 Does constructMap include a sign.
bool & constructHasFlip () noexcept
 Does constructMap include a sign.
label comm () const noexcept
 The communicator used.
label nMaps () const noexcept
 The number of sub-lists within the maps.
labelList subMapSizes () const
 The sizes of the subMap lists.
labelList constructMapSizes () const
 The sizes of the constructMap lists.
label subMapTotalSize () const noexcept
 The sum of the subMap list sizes.
label constructMapTotalSize () const noexcept
 The sum of the constructMap list sizes.
const List< labelPair > & schedule () const
 Return a schedule. Demand driven. See above.
const List< labelPair > & whichSchedule (const UPstream::commsTypes commsType) const
 Return real or dummy schedule depending on the communication type.
void clear ()
 Reset to zero size, only retaining communicator.
void transfer (mapDistributeBase &rhs)
 Transfer the contents of the argument and annul the argument.
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.
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.
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.
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.
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.
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.
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.
template<class T>
void distribute (List< T > &values, const int tag=UPstream::msgType()) const
 Distribute List data using default commsType and the default flip/negate operator.
template<class T>
void distribute (DynamicList< T > &values, const int tag=UPstream::msgType()) const
 Distribute DynamicList data using default commsType and the default flip/negate operator.
template<class T>
void distribute (const UPstream::commsTypes commsType, List< T > &values, const int tag=UPstream::msgType()) const
 Distribute List data using specified commsType and the default flip/negate operator.
template<class T>
void distribute (const UPstream::commsTypes commsType, DynamicList< T > &values, const int tag=UPstream::msgType()) const
 Distribute DynamicList data using specified commsType and the default flip/negate operator.
template<class T, class NegateOp>
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).
template<class T, class NegateOp>
void distribute (const UPstream::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).
template<class T, class NegateOp>
void distribute (const UPstream::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).
template<class T>
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.
template<class T>
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.
template<class T>
void reverseDistribute (const UPstream::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.
template<class T, class NegateOp>
void reverseDistribute (const UPstream::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.
template<class T>
void reverseDistribute (const UPstream::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.
template<class T>
void send (PstreamBuffers &pBufs, const UList< T > &field) const
 Do all sends using PstreamBuffers.
template<class T>
void receive (PstreamBuffers &pBufs, List< T > &field) const
 Do all receives using PstreamBuffers.
template<class T>
void send (const UList< T > &field, labelRange &sendRequests, PtrList< List< T > > &sendFields, labelRange &recvRequests, PtrList< List< T > > &recvFields, const int tag=UPstream::msgType()) const
 Start all sends and receives (always non-blocking).
template<class T>
void receive (const labelRange &requests, const UPtrList< List< T > > &recvFields, List< T > &field, const int tag=UPstream::msgType()) const
 Wait for (receive) requests to finish and consume.
void printLayout (Ostream &os) const
 Debug: print layout. Can only be used on maps with sorted.
void operator= (const mapDistributeBase &rhs)
 Copy assignment.
void operator= (mapDistributeBase &&rhs)
 Move assignment.
InfoProxy< mapDistributeBaseinfo () const noexcept
 Return info proxy, used to print summary information to a stream.
void readDict (const dictionary &dict)
 Read entries from dictionary format.
void writeEntries (Ostream &os) const
 Write entries in dictionary format.
void updateMesh (const mapPolyMesh &)
 No correction for topo change.
void compact (const boolList &remoteElemUsed, const int tag=UPstream::msgType())
 OpenFOAM-v2112 and earlier naming for compactRemoteData() using boolList.
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.
template<class T, class NegateOp>
Foam::List< TaccessAndFlip (const UList< T > &values, const labelUList &map, const bool hasFlip, const NegateOp &negOp)

Static Public Member Functions

static bool hasFlipAddressing (const labelUList &map)
 Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as positive non-zero indices.
static bool hasFlipAddressing (const labelListList &maps)
 Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as positive non-zero indices.
static label countUnmapped (const labelUList &elements, const labelListList &maps, const bool hasFlip)
 Count the number of unmapped elements.
static List< labelPairschedule (const labelListList &subMap, const labelListList &constructMap, const int tag, const label comm=UPstream::worldComm)
 Calculate a communication schedule. See above.
static label renumber (const globalIndex &, const label comm, const List< Map< label > > &compactMap, const label globalElement)
 Helper for construct from globalIndex. Renumbers element.
static label renumberMap (labelListList &mapElements, const labelUList &oldToNew, const bool hasFlip)
 Helper for renumbering the (compacted) map elements using the supplied old-to-new mapping.
static label renumberMap (labelList &map, const label localSize, const label offset, const Map< label > &cMap, const bool hasFlip)
 Helper for renumbering the map elements. Assumes local elements are first, followed by any remote. Local elements get offset, remote elements are mapped.
static label renumberMap (labelListList &mapElements, const label localSize, const label offset, const Map< label > &cMap, const bool hasFlip)
 Helper for a list of maps. Calls above renumberMap for all elements.
template<class T, class CombineOp, class NegateOp>
static void distribute (const UPstream::commsTypes commsType, const UList< 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 combine data with specified combine operation and negate operator (for flips).
template<class T, class CombineOp, class NegateOp>
static void distribute (const UPstream::commsTypes commsType, const UList< labelPair > &schedule, const UList< T > &inField, const labelListList &subMap, const bool subHasFlip, List< T > &field, const label constructSize, const labelListList &constructMap, const bool constructHasFlip, const T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
 Distribute combine data with specified combine operation and negate operator (for flips).
template<class T, class NegateOp>
static void distribute (const UPstream::commsTypes commsType, const UList< 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 assign data with specified negate operator (for flips). Uses assignment for combine operation.
template<class T, class negateOp>
static void send (const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, const UList< T > &field, labelRange &sendRequests, PtrList< List< T > > &sendFields, labelRange &recvRequests, PtrList< List< T > > &recvFields, const negateOp &negOp, const int tag, const label comm)
 Start all sends and receives (always non-blocking).
template<class T, class CombineOp, class negateOp>
static void receive (const label constructSize, const labelListList &constructMap, const bool constructHasFlip, const labelRange &requests, const UPtrList< List< T > > &recvFields, List< T > &field, const CombineOp &cop, const negateOp &negOp, const int tag, const label comm)
 Wait for (receive) requests to finish and consume.

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.
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 != received size.
static label getMappedSize (const labelListList &maps, const bool hasFlip)
 Scan the maps for the max addressed index.
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.
static void unionCombineMasks (UList< bitSet > &sendMasks, UList< bitSet > &recvMasks, const int tag, const label comm)
 Bi-direction sync of send/recv buffers using bitwise '&=' combine operation.
template<class T, class CombineOp, class NegateOp>
static void flipAndCombine (UList< T > &lhs, const UList< T > &rhs, const labelUList &map, const bool hasFlip, const CombineOp &cop, const NegateOp &negOp)
 Combine field values (after any flip negation operation) into the specified mapped target locations.
template<class T, class NegateOp>
static void accessAndFlip (UList< T > &output, const UList< T > &values, const labelUList &map, const bool hasFlip, const NegateOp &negOp)
 Lookup field values at specified map indices and save after any flip negation operations.
template<class T, class NegateOp>
static List< TaccessAndFlip (const UList< T > &values, const labelUList &map, const bool hasFlip, const NegateOp &negOp)
 Lookup field values at specified indices and return after any flip negation operations.

Friends

Istreamoperator>> (Istream &, mapDistributeBase &)
 Read plain content (not dictionary) from Istream.
Ostreamoperator<< (Ostream &, const mapDistributeBase &)
 Write plain content (not dictionary) to Ostream.

Detailed Description

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

  • all my own elements first (whether used or not)
  • followed by used-only remote elements sorted by remote processor. So e.g 4 procs and on proc 1 the compact table will first have all globalIndex.localSize() elements from proc1 followed by used-only elements of proc0, proc2, proc3. The constructed mapDistributeBase sends the local elements from and receives the remote elements into their compact position. compactMap[proci] is the position of elements from proci in the compact map. compactMap[myProcNo()] is empty since trivial addressing.

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)

Source files

Definition at line 103 of file mapDistributeBase.H.

Member Enumeration Documentation

◆ layoutTypes

enum class layoutTypes : char
strong

The map layout (eg, of the constructMap).

Enumerator
linear 

In processor-order.

localFirst 

Local processor first, others in linear order.

Definition at line 110 of file mapDistributeBase.H.

Constructor & Destructor Documentation

◆ mapDistributeBase() [1/13]

mapDistributeBase ( )
noexcept

◆ mapDistributeBase() [2/13]

mapDistributeBase ( const label comm)
explicitnoexcept

Default construct with specified communicator.

Definition at line 636 of file mapDistributeBase.C.

References comm(), and Foam::noexcept.

Here is the call graph for this function:

◆ mapDistributeBase() [3/13]

mapDistributeBase ( const mapDistributeBase & map)

Copy construct.

Definition at line 648 of file mapDistributeBase.C.

References mapDistributeBase().

Here is the call graph for this function:

◆ mapDistributeBase() [4/13]

mapDistributeBase ( mapDistributeBase && map)

Move construct.

Definition at line 660 of file mapDistributeBase.C.

References comm(), mapDistributeBase(), and transfer().

Here is the call graph for this function:

◆ mapDistributeBase() [5/13]

mapDistributeBase ( const dictionary & dict,
const label comm = UPstream::worldComm )
explicit

Read construct from dictionary.

Definition at line 74 of file mapDistributeBaseIO.C.

References comm(), dict, mapDistributeBase(), and readDict().

Here is the call graph for this function:

◆ mapDistributeBase() [6/13]

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 668 of file mapDistributeBase.C.

References comm(), constructHasFlip(), constructMap(), constructSize(), subHasFlip(), and subMap().

Here is the call graph for this function:

◆ mapDistributeBase() [7/13]

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.

Note
data is not sorted per processor - cannot use printLayout!

Definition at line 688 of file mapDistributeBase.C.

References Foam::abort(), comm(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::myProcNo(), UPstream::nProcs(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ mapDistributeBase() [8/13]

mapDistributeBase ( const globalIndex & globalNumbering,
labelList & elements,
List< Map< label > > & compactMap,
const int tag = UPstream::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 773 of file mapDistributeBase.C.

References calcCompactAddressing(), comm(), exchangeAddressing(), Foam::Pout, and printLayout().

Here is the call graph for this function:

◆ mapDistributeBase() [9/13]

mapDistributeBase ( const globalIndex & globalNumbering,
labelListList & cellCells,
List< Map< label > > & compactMap,
const int tag = UPstream::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 836 of file mapDistributeBase.C.

References calcCompactAddressing(), comm(), exchangeAddressing(), Foam::Pout, and printLayout().

Here is the call graph for this function:

◆ mapDistributeBase() [10/13]

mapDistributeBase ( const layoutTypes constructLayout,
labelListList && subMap,
const bool subHasFlip = false,
const bool constructHasFlip = false,
const label comm = UPstream::worldComm )
explicit

Construct from my elements to send, targetting the specified constructMap layout.

Definition at line 899 of file mapDistributeBase.C.

References comm(), constructHasFlip(), Pstream::exchangeSizes(), forAll, Foam::identity(), linear, UPstream::myProcNo(), UPstream::nProcs(), subHasFlip(), and subMap().

Here is the call graph for this function:

◆ mapDistributeBase() [11/13]

mapDistributeBase ( labelListList && subMap,
const bool subHasFlip = false,
const bool constructHasFlip = false,
const label comm = UPstream::worldComm )
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 965 of file mapDistributeBase.C.

References comm(), constructHasFlip(), mapDistributeBase(), subHasFlip(), and subMap().

Here is the call graph for this function:

◆ mapDistributeBase() [12/13]

mapDistributeBase ( const UPtrList< const mapDistributeBase > & maps,
const labelList & localRanks,
const label newComm,
const labelListList & newToOldRanks,
labelList & startOfLocal,
List< Map< label > > & compactMaps )

Construct from multiple maps and processor collation.

Assumes all local data first. Sorts contributions of maps in processor order i.e. constructed map has all local data first. Returns

  • startOfLocal : per input map the start of the local data. Extends one beyond number of maps so overall local size is startOfLocal.last()
  • compactMaps : per input map from slot position in the input map to new slot position. (note there is no information returned about which processor it is from)

Definition at line 984 of file mapDistributeBase.C.

References constructMap(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), forAll, Foam::labelMax, UList< T >::last(), Foam::mag(), Foam::max(), Foam::min(), UPstream::myProcNo(), UPstream::nProcs(), List< T >::resize_nocopy(), UPtrList< T >::set(), List< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), and subMap().

Here is the call graph for this function:

◆ mapDistributeBase() [13/13]

mapDistributeBase ( Istream & is)
explicit

Construct from Istream.

Definition at line 86 of file mapDistributeBaseIO.C.

Member Function Documentation

◆ checkReceivedSize()

void checkReceivedSize ( const label proci,
const label expectedSize,
const label receivedSize )
staticprotected

Fatal if expected != received size.

Definition at line 159 of file mapDistributeBase.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Referenced by distribute(), distribute(), distribute(), receive(), and receive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMappedSize()

Foam::label getMappedSize ( const labelListList & maps,
const bool hasFlip )
staticprotected

Scan the maps for the max addressed index.

Parameters
mapsThe maps to scan
hasFlipTrue if maps has flip addressing
Returns
max-size needed for addressing (eg, constructSize)

Definition at line 82 of file mapDistributeBase.C.

References Foam::mag(), and Foam::max().

Here is the call graph for this function:

◆ calcCompactAddressing() [1/2]

void calcCompactAddressing ( const globalIndex & globalNumbering,
const labelUList & elements,
List< Map< label > > & compactMap ) const
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 365 of file mapDistributeBase.C.

References forAll, globalIndex::isLocal(), UPstream::myProcNo(), UPstream::nProcs(), globalIndex::toLocal(), globalIndex::whichProcID(), and Foam::Zero.

Referenced by mapDistribute::mapDistribute(), mapDistribute::mapDistribute(), mapDistributeBase(), and mapDistributeBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcCompactAddressing() [2/2]

void calcCompactAddressing ( const globalIndex & globalNumbering,
const labelListList & elements,
List< Map< label > > & compactMap ) const
protected

Definition at line 412 of file mapDistributeBase.C.

References forAll, globalIndex::isLocal(), UPstream::myProcNo(), UPstream::nProcs(), globalIndex::whichProcID(), and Foam::Zero.

Here is the call graph for this function:

◆ exchangeAddressing() [1/2]

void exchangeAddressing ( const int tag,
const globalIndex & globalNumbering,
labelList & elements,
List< Map< label > > & compactMap,
labelList & compactStart )
protected

Definition at line 465 of file mapDistributeBase.C.

References UPstream::myProcNo(), and UPstream::nProcs().

Referenced by mapDistribute::mapDistribute(), mapDistribute::mapDistribute(), mapDistributeBase(), and mapDistributeBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exchangeAddressing() [2/2]

void exchangeAddressing ( const int tag,
const globalIndex & globalNumbering,
labelListList & elements,
List< Map< label > > & compactMap,
labelList & compactStart )
protected

Definition at line 545 of file mapDistributeBase.C.

◆ exchangeMasks()

void exchangeMasks ( const UList< bitSet > & sendMasks,
UList< bitSet > & recvMasks,
const int tag,
const label comm )
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 112 of file mapDistributeBaseSubset.C.

References Foam::abort(), comm(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::myProcNo(), Foam::nl, UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), UPstream::parRun(), UIPstream::read(), UList< T >::size(), UPstream::waitRequests(), and UOPstream::write().

Referenced by unionCombineMasks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unionCombineMasks()

void unionCombineMasks ( UList< bitSet > & sendMasks,
UList< bitSet > & recvMasks,
const int tag,
const label comm )
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 191 of file mapDistributeBaseSubset.C.

References Foam::abort(), comm(), exchangeMasks(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::myProcNo(), Foam::nl, UPstream::parRun(), List< T >::resize(), and UList< T >::size().

Here is the call graph for this function:

◆ flipAndCombine()

template<class T, class CombineOp, class NegateOp>
void flipAndCombine ( UList< T > & lhs,
const UList< T > & rhs,
const labelUList & map,
const bool hasFlip,
const CombineOp & cop,
const NegateOp & negOp )
staticprotected

Combine field values (after any flip negation operation) into the specified mapped target locations.

Parameters
[in,out]lhsThe left of binary combine operation
rhsThe right of binary combine operation
mapThe mapping indices
hasFlipMapping indices include flip encoding
copBinary combine operation
negOpUnary negation operation (for flipped indices)

Definition at line 29 of file mapDistributeBaseTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, Foam::rhs(), and UList< T >::size().

Referenced by distribute(), distribute(), distribute(), receive(), and receive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ accessAndFlip() [1/3]

template<class T, class NegateOp>
void accessAndFlip ( UList< T > & output,
const UList< T > & values,
const labelUList & map,
const bool hasFlip,
const NegateOp & negOp )
staticprotected

Lookup field values at specified map indices and save after any flip negation operations.

Parameters
[out]outputThe result values
valuesThe input values
mapThe mapping indices
hasFlipMapping indices include flip encoding
negOpUnary negation operation (for flipped indices)

Definition at line 79 of file mapDistributeBaseTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and UList< T >::size().

Referenced by accessAndFlip(), distribute(), distribute(), distribute(), send(), and send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ accessAndFlip() [2/3]

template<class T, class NegateOp>
List< T > accessAndFlip ( const UList< T > & values,
const labelUList & map,
const bool hasFlip,
const NegateOp & negOp )
staticprotected

Lookup field values at specified indices and return after any flip negation operations.

Parameters
valuesThe input values
mapThe mapping indices
hasFlipMapping indices include flip encoding
negOpUnary negation operation (for flipped indices)

◆ ClassName()

ClassName ( "mapDistributeBase" )

◆ hasFlipAddressing() [1/2]

bool hasFlipAddressing ( const labelUList & map)
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.

Note
may return a false negative (ie, no flips detected) even when flip addressing is used, but the local map does not contain any flipped elements

Definition at line 39 of file mapDistributeBase.C.

Referenced by ClassName().

Here is the caller graph for this function:

◆ hasFlipAddressing() [2/2]

bool hasFlipAddressing ( const labelListList & maps)
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 59 of file mapDistributeBase.C.

◆ countUnmapped()

Foam::label countUnmapped ( const labelUList & elements,
const labelListList & maps,
const bool hasFlip )
static

Count the number of unmapped elements.

Parameters
elementsThe elements that are expected to be mapped
mapsThe maps to scan
hasFlipTrue if maps has flip addressing
Returns
number of unmapped elements

Definition at line 107 of file mapDistributeBase.C.

References bitSet::count(), UList< T >::empty(), Foam::mag(), and bitSet::unset().

Referenced by ClassName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constructSize() [1/2]

label constructSize ( ) const
inlinenoexcept

Constructed data size.

Definition at line 641 of file mapDistributeBase.H.

References constructSize(), and Foam::noexcept.

Referenced by AMIInterpolation::agglomerate(), LeastSquaresGrad< Type, Stencil >::calcGrad(), mapDistribute::ClassName(), ClassName(), extendedCellToFaceStencil::collectData(), extendedFaceToCellStencil::collectData(), constructSize(), meshRefinement::countEdgeFaces(), distribute(), distribute(), distribute(), mappedPatchFieldBase< Type >::distribute(), faMeshBoundaryHalo::distributeSparse(), PatchTools::edgeNormals(), PatchTools::edgeNormals(), pointMeshTools::featurePointsEdges(), globalIndexAndTransform::globalIndexAndTransform(), AMIInterpolation::interpolate(), mapDistribute::mapDistribute(), mapDistribute::mapDistribute(), mapDistribute::mapDistribute(), mapDistributeBase(), globalMeshData::mergePoints(), globalMeshData::mergePoints(), PatchTools::pointNormals(), PatchTools::pointNormals(), volPointInterpolationAdjoint::pushUntransformedData(), receive(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), reverseDistribute(), reverseDistribute(), reverseDistribute(), reverseDistribute(), reverseDistribute(), distributedWeightedFvPatchFieldMapper::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), pointConstraints::syncUntransformedData(), and streamLineBase::writeToFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constructSize() [2/2]

label & constructSize ( )
inlinenoexcept

Constructed data size.

Definition at line 649 of file mapDistributeBase.H.

References Foam::noexcept.

◆ subMap() [1/2]

◆ subMap() [2/2]

labelListList & subMap ( )
inlinenoexcept

From subsetted data back to original data.

Definition at line 665 of file mapDistributeBase.H.

References Foam::noexcept.

◆ constructMap() [1/2]

◆ constructMap() [2/2]

labelListList & constructMap ( )
inlinenoexcept

From subsetted data to new reconstructed data.

Definition at line 681 of file mapDistributeBase.H.

References Foam::noexcept.

◆ subHasFlip() [1/2]

◆ subHasFlip() [2/2]

bool & subHasFlip ( )
inlinenoexcept

Does subMap include a sign.

Definition at line 697 of file mapDistributeBase.H.

References Foam::noexcept.

◆ constructHasFlip() [1/2]

◆ constructHasFlip() [2/2]

bool & constructHasFlip ( )
inlinenoexcept

Does constructMap include a sign.

Definition at line 713 of file mapDistributeBase.H.

References Foam::noexcept.

◆ comm()

◆ nMaps()

label nMaps ( ) const
inlinenoexcept

The number of sub-lists within the maps.

Definition at line 729 of file mapDistributeBase.H.

References Foam::noexcept.

◆ subMapSizes()

Foam::labelList subMapSizes ( ) const

The sizes of the subMap lists.

Definition at line 1578 of file mapDistributeBase.C.

References forAll, and UList< T >::size().

Here is the call graph for this function:

◆ constructMapSizes()

Foam::labelList constructMapSizes ( ) const

The sizes of the constructMap lists.

Definition at line 1589 of file mapDistributeBase.C.

References forAll, and UList< T >::size().

Here is the call graph for this function:

◆ subMapTotalSize()

Foam::label subMapTotalSize ( ) const
noexcept

The sum of the subMap list sizes.

Definition at line 1600 of file mapDistributeBase.C.

References Foam::noexcept.

◆ constructMapTotalSize()

Foam::label constructMapTotalSize ( ) const
noexcept

The sum of the constructMap list sizes.

Definition at line 1611 of file mapDistributeBase.C.

References Foam::noexcept.

◆ schedule() [1/2]

Foam::List< Foam::labelPair > schedule ( const labelListList & subMap,
const labelListList & constructMap,
const int tag,
const label comm = UPstream::worldComm )
static

◆ schedule() [2/2]

const Foam::List< Foam::labelPair > & schedule ( ) const

Return a schedule. Demand driven. See above.

Definition at line 258 of file mapDistributeBase.C.

References UPstream::msgType(), and schedule().

Here is the call graph for this function:

◆ whichSchedule()

const Foam::List< Foam::labelPair > & whichSchedule ( const UPstream::commsTypes commsType) const

Return real or dummy schedule depending on the communication type.

Definition at line 275 of file mapDistributeBase.C.

References List< T >::null(), schedule(), and UPstream::scheduled.

Referenced by distribute(), distribute(), reverseDistribute(), and reverseDistribute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void clear ( )

Reset to zero size, only retaining communicator.

Definition at line 1622 of file mapDistributeBase.C.

Referenced by mapDistribute::clear().

Here is the caller graph for this function:

◆ transfer()

void transfer ( mapDistributeBase & rhs)

Transfer the contents of the argument and annul the argument.

Definition at line 1634 of file mapDistributeBase.C.

References mapDistributeBase(), and Foam::rhs().

Referenced by mapDistributeBase(), operator=(), and mapDistribute::transfer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renumber()

Foam::label renumber ( const globalIndex & globalNumbering,
const label comm,
const List< Map< label > > & compactMap,
const label globalElement )
static

Helper for construct from globalIndex. Renumbers element.

(in globalIndex numbering) into compact indices.

Definition at line 1656 of file mapDistributeBase.C.

References comm(), globalIndex::isLocal(), UPstream::myProcNo(), globalIndex::toLocal(), and globalIndex::whichProcID().

Here is the call graph for this function:

◆ renumberMap() [1/3]

Foam::label renumberMap ( labelListList & mapElements,
const labelUList & oldToNew,
const bool hasFlip )
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.

Parameters
[in,out]mapElementsThe map to be renumbered
oldToNewThe old-to-new mapping
hasFlipTrue if map has flip addressing
Returns
max-size needed for new addressing (eg, constructSize)

Definition at line 273 of file mapDistributeBaseSubset.C.

References Foam::mag(), and Foam::max().

Referenced by cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), cyclicAMIGAMGInterface::cyclicAMIGAMGInterface(), and renumberMap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renumberMap() [2/3]

Foam::label renumberMap ( labelList & map,
const label localSize,
const label offset,
const Map< label > & cMap,
const bool hasFlip )
static

Helper for renumbering the map elements. Assumes local elements are first, followed by any remote. Local elements get offset, remote elements are mapped.

Parameters
[in,out]mapThe map to be renumbered
localSizeelements < localSize are offset
offsetoffset
cMapmap for non-local elements
hasFlipTrue if map has flip addressing
Returns
max-size needed for new addressing (eg, constructSize)

Definition at line 325 of file mapDistributeBaseSubset.C.

References Foam::mag(), and Foam::max().

Here is the call graph for this function:

◆ renumberMap() [3/3]

Foam::label renumberMap ( labelListList & mapElements,
const label localSize,
const label offset,
const Map< label > & cMap,
const bool hasFlip )
static

Helper for a list of maps. Calls above renumberMap for all elements.

Definition at line 391 of file mapDistributeBaseSubset.C.

References Foam::max(), and renumberMap().

Here is the call graph for this function:

◆ compactLocalData() [1/3]

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.

Parameters
allowedLocalElemsPermissible local mapped elements (true/false). Can be longer/shorter than actual number of mapped elements.
tagThe message tag
doRenumberApply oldToNew internally to renumber entries (uses renumberMap) and adjust the constructSize
Note
generally preferable to compact based on remote data (ie, the actual receiver)

Definition at line 892 of file mapDistributeBaseSubset.C.

◆ compactRemoteData() [1/3]

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.

Parameters
allowedRemoteElemsPermissible remote mapped elements (true/false). Can be longer/shorter than actual number of mapped elements.
tagThe message tag
doRenumberApply oldToNew internally to renumber entries (uses renumberMap) and adjust the constructSize

Definition at line 914 of file mapDistributeBaseSubset.C.

Referenced by compact(), and compact().

Here is the caller graph for this function:

◆ compactLocalData() [2/3]

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.

Parameters
allowedLocalElemsPermissible local mapped elements (true/false). Can be longer/shorter than actual number of mapped elements.
[out]oldToNewSubOld-to-new mapping: subMap Disabled if labelList::null(),
[out]oldToNewConstructOld-to-new mapping: constructMap Disabled if labelList::null(),
localSizeThe max index for subMap (-1: auto-detect)
tagThe message tag
Note
Applies oldToNew to renumber entries (uses renumberMap) and adjust constructSize
generally preferable to compact based on remote data (ie, the actual receiver)

Definition at line 936 of file mapDistributeBaseSubset.C.

◆ compactRemoteData() [2/3]

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.

Parameters
allowedRemoteElemsPermissible remote mapped elements (true/false). Can be longer/shorter than actual number of mapped elements.
[out]oldToNewSubOld-to-new mapping: subMap Disabled if labelList::null(),
[out]oldToNewConstructOld-to-new mapping: constructMap Disabled if labelList::null(),
localSizeThe max index for subMap (-1: auto-detect)
tagThe message tag
Note
Applies oldToNew to renumber entries (uses renumberMap) and adjust constructSize

Definition at line 967 of file mapDistributeBaseSubset.C.

◆ compactData()

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.
Warning
ill-defined behaviour if localElements or remoteElements contains duplicates.

Definition at line 720 of file mapDistributeBaseSubset.C.

◆ compactLocalData() [3/3]

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.
Warning
ill-defined behaviour if localElements contains duplicates.
Note
generally preferable to compact based on remote data (ie, the actual receiver)

Definition at line 772 of file mapDistributeBaseSubset.C.

◆ compactRemoteData() [3/3]

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.
Warning
ill-defined behaviour if remoteElements contains duplicates.

Definition at line 814 of file mapDistributeBaseSubset.C.

◆ distribute() [1/10]

template<class T, class CombineOp, class NegateOp>
void distribute ( const UPstream::commsTypes commsType,
const UList< 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 )
static

Distribute combine data with specified combine operation and negate operator (for flips).

If multiple processors write to same position, contributions are added using the combine cop.

Note
schedule only used for UPstream::commsTypes::scheduled, others just use send-to-all, receive-from-all.

Definition at line 444 of file mapDistributeBaseTemplates.C.

References Foam::abort(), accessAndFlip(), UPstream::allProcs(), UPstream::buffered, checkReceivedSize(), comm(), constructHasFlip(), constructMap(), constructSize(), Foam::FatalError, FatalErrorInFunction, field(), PstreamBuffers::finishedSends(), flipAndCombine(), Foam::is_contiguous_v, UPstream::myProcNo(), UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), os(), UPstream::parRun(), DynamicList< T, SizeMin >::push_back(), UIPstream::read(), IPstream::recv(), List< T >::resize_nocopy(), schedule(), UPstream::scheduled, UOPstream::send(), UList< T >::size(), subHasFlip(), subMap(), Foam::T(), UPstream::waitRequests(), UPstream::waitSomeRequests(), and UOPstream::write().

Referenced by faceAreaWeightAMI2D::calculate(), faceAreaWeightAMI::calculate(), inverseDistance::createStencil(), mapDistribute::distribute(), distribute(), distribute(), distribute(), distribute(), distribute(), distribute(), distribute(), mappedPatchBase::distribute(), faMeshBoundaryHalo::distributeSparse(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getVolumeType(), inverseDistance::holeExtrapolationStencil(), Field< Type >::map(), Field< TypeGrad >::map(), reverseDistribute(), reverseDistribute(), mappedPatchBase::reverseDistribute(), and streamLineBase::writeToFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distribute() [2/10]

template<class T, class CombineOp, class NegateOp>
void distribute ( const UPstream::commsTypes commsType,
const UList< labelPair > & schedule,
const UList< T > & inField,
const labelListList & subMap,
const bool subHasFlip,
List< T > & field,
const label constructSize,
const labelListList & constructMap,
const bool constructHasFlip,
const T & nullValue,
const CombineOp & cop,
const NegateOp & negOp,
const int tag = UPstream::msgType(),
const label comm = UPstream::worldComm )
static

◆ distribute() [3/10]

template<class T, class NegateOp>
void distribute ( const UPstream::commsTypes commsType,
const UList< 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 )
static

◆ distribute() [4/10]

template<class T>
void distribute ( List< T > & values,
const int tag = UPstream::msgType() ) const

Distribute List data using default commsType and the default flip/negate operator.

Definition at line 1760 of file mapDistributeBaseTemplates.C.

References UPstream::defaultCommsType, and distribute().

Here is the call graph for this function:

◆ distribute() [5/10]

template<class T>
void distribute ( DynamicList< T > & values,
const int tag = UPstream::msgType() ) const

Distribute DynamicList data using default commsType and the default flip/negate operator.

Definition at line 1771 of file mapDistributeBaseTemplates.C.

References UPstream::defaultCommsType, and distribute().

Here is the call graph for this function:

◆ distribute() [6/10]

template<class T>
void distribute ( const UPstream::commsTypes commsType,
List< T > & values,
const int tag = UPstream::msgType() ) const

Distribute List data using specified commsType and the default flip/negate operator.

Definition at line 1732 of file mapDistributeBaseTemplates.C.

References distribute().

Here is the call graph for this function:

◆ distribute() [7/10]

template<class T>
void distribute ( const UPstream::commsTypes commsType,
DynamicList< T > & values,
const int tag = UPstream::msgType() ) const

Distribute DynamicList data using specified commsType and the default flip/negate operator.

Definition at line 1744 of file mapDistributeBaseTemplates.C.

References distribute().

Here is the call graph for this function:

◆ distribute() [8/10]

template<class T, class NegateOp>
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 1717 of file mapDistributeBaseTemplates.C.

References UPstream::defaultCommsType, and distribute().

Here is the call graph for this function:

◆ distribute() [9/10]

template<class T, class NegateOp>
void distribute ( const UPstream::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 1662 of file mapDistributeBaseTemplates.C.

References distribute(), and whichSchedule().

Here is the call graph for this function:

◆ distribute() [10/10]

template<class T, class NegateOp>
void distribute ( const UPstream::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 1688 of file mapDistributeBaseTemplates.C.

References distribute(), Foam::T(), and whichSchedule().

Here is the call graph for this function:

◆ reverseDistribute() [1/5]

template<class T>
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 1860 of file mapDistributeBaseTemplates.C.

References constructSize(), UPstream::defaultCommsType, and reverseDistribute().

Referenced by mapDistribute::reverseDistribute(), mapDistribute::reverseDistribute(), reverseDistribute(), reverseDistribute(), and reverseDistribute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reverseDistribute() [2/5]

template<class T>
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 1878 of file mapDistributeBaseTemplates.C.

References constructSize(), UPstream::defaultCommsType, reverseDistribute(), and Foam::T().

Here is the call graph for this function:

◆ reverseDistribute() [3/5]

template<class T>
void reverseDistribute ( const UPstream::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 1782 of file mapDistributeBaseTemplates.C.

References constructSize(), and reverseDistribute().

Here is the call graph for this function:

◆ reverseDistribute() [4/5]

template<class T, class NegateOp>
void reverseDistribute ( const UPstream::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 1802 of file mapDistributeBaseTemplates.C.

References constructSize(), distribute(), and whichSchedule().

Here is the call graph for this function:

◆ reverseDistribute() [5/5]

template<class T>
void reverseDistribute ( const UPstream::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 1829 of file mapDistributeBaseTemplates.C.

References constructSize(), distribute(), Foam::T(), and whichSchedule().

Here is the call graph for this function:

◆ send() [1/3]

template<class T>
void send ( PstreamBuffers & pBufs,
const UList< T > & field ) const

Do all sends using PstreamBuffers.

Definition at line 1598 of file mapDistributeBaseTemplates.C.

References accessAndFlip(), UPstream::allProcs(), field(), PstreamBuffers::finishedSends(), os(), and UList< T >::size().

Referenced by send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receive() [1/3]

template<class T>
void receive ( PstreamBuffers & pBufs,
List< T > & field ) const

Do all receives using PstreamBuffers.

Definition at line 1627 of file mapDistributeBaseTemplates.C.

References UPstream::allProcs(), checkReceivedSize(), field(), flipAndCombine(), and UList< T >::size().

Referenced by receive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send() [2/3]

template<class T, class negateOp>
void send ( const labelListList & subMap,
const bool subHasFlip,
const labelListList & constructMap,
const bool constructHasFlip,
const UList< T > & field,
labelRange & sendRequests,
PtrList< List< T > > & sendFields,
labelRange & recvRequests,
PtrList< List< T > > & recvFields,
const negateOp & negOp,
const int tag,
const label comm )
static

Start all sends and receives (always non-blocking).

Parameters
sendRequestsThe send requests range
sendFieldsThe send fields storage
recvRequestsThe recv requests range
recvFieldsThe recv fields storage

Definition at line 143 of file mapDistributeBaseTemplates.C.

References Foam::abort(), accessAndFlip(), UPstream::allProcs(), comm(), constructHasFlip(), constructMap(), UList< T >::empty(), Foam::FatalError, FatalErrorInFunction, field(), Foam::is_contiguous_v, UPstream::myProcNo(), UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), UIPstream::read(), List< T >::resize_nocopy(), IntRange< IntType >::size(), UList< T >::size(), IntRange< IntType >::start(), subHasFlip(), subMap(), and UOPstream::write().

Here is the call graph for this function:

◆ send() [3/3]

template<class T>
void send ( const UList< T > & field,
labelRange & sendRequests,
PtrList< List< T > > & sendFields,
labelRange & recvRequests,
PtrList< List< T > > & recvFields,
const int tag = UPstream::msgType() ) const

Start all sends and receives (always non-blocking).

Parameters
sendRequestsThe send requests range
sendFieldsThe send fields storage
recvRequestsThe recv requests range
recvFieldsThe recv fields storage

Definition at line 275 of file mapDistributeBaseTemplates.C.

References field(), and send().

Here is the call graph for this function:

◆ receive() [2/3]

template<class T, class CombineOp, class negateOp>
void receive ( const label constructSize,
const labelListList & constructMap,
const bool constructHasFlip,
const labelRange & requests,
const UPtrList< List< T > > & recvFields,
List< T > & field,
const CombineOp & cop,
const negateOp & negOp,
const int tag,
const label comm )
static

◆ receive() [3/3]

template<class T>
void receive ( const labelRange & requests,
const UPtrList< List< T > > & recvFields,
List< T > & field,
const int tag = UPstream::msgType() ) const

Wait for (receive) requests to finish and consume.

Definition at line 419 of file mapDistributeBaseTemplates.C.

References field(), and receive().

Here is the call graph for this function:

◆ printLayout()

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 289 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(), Foam::nl, UPstream::nProcs(), and os().

Referenced by mapDistributeBase(), mapDistributeBase(), and mapDistribute::printLayout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

void operator= ( const mapDistributeBase & rhs)

Copy assignment.

Definition at line 1685 of file mapDistributeBase.C.

References mapDistributeBase(), and Foam::rhs().

Referenced by mapDistribute::operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/2]

void operator= ( mapDistributeBase && rhs)

Move assignment.

Definition at line 1702 of file mapDistributeBase.C.

References mapDistributeBase(), Foam::rhs(), and transfer().

Here is the call graph for this function:

◆ info()

InfoProxy< mapDistributeBase > info ( ) const
inlinenoexcept

Return info proxy, used to print summary information to a stream.

Definition at line 1419 of file mapDistributeBase.H.

References info(), mapDistributeBase(), and Foam::noexcept.

Referenced by info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDict()

void readDict ( const dictionary & dict)

Read entries from dictionary format.

Definition at line 94 of file mapDistributeBaseIO.C.

References dict, and dictionary::readEntry().

Referenced by mapDistributeBase(), and mapDistribute::readDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeEntries()

void writeEntries ( Ostream & os) const

Write entries in dictionary format.

Definition at line 116 of file mapDistributeBaseIO.C.

References Foam::nl, os(), and Foam::writeMaps().

Referenced by mapDistribute::writeEntries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateMesh()

void updateMesh ( const mapPolyMesh & )
inline

No correction for topo change.

Definition at line 1450 of file mapDistributeBase.H.

References NotImplemented.

◆ compact() [1/2]

void compact ( const boolList & remoteElemUsed,
const int tag = UPstream::msgType() )

OpenFOAM-v2112 and earlier naming for compactRemoteData() using boolList.

Definition at line 1000 of file mapDistributeBaseSubset.C.

References compactRemoteData().

Here is the call graph for this function:

◆ compact() [2/2]

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 1011 of file mapDistributeBaseSubset.C.

References compactRemoteData().

Here is the call graph for this function:

◆ accessAndFlip() [3/3]

template<class T, class NegateOp>
Foam::List< T > accessAndFlip ( const UList< T > & values,
const labelUList & map,
const bool hasFlip,
const NegateOp & negOp )

Definition at line 128 of file mapDistributeBaseTemplates.C.

References accessAndFlip(), and UList< T >::size().

Here is the call graph for this function:

◆ operator>>

Istream & operator>> ( Istream & ,
mapDistributeBase &  )
friend

Read plain content (not dictionary) from Istream.

References mapDistributeBase().

◆ operator<<

Ostream & operator<< ( Ostream & ,
const mapDistributeBase &  )
friend

Write plain content (not dictionary) to Ostream.

References mapDistributeBase().


The documentation for this class was generated from the following files: