74#ifndef Foam_mapDistributeBase_H
75#define Foam_mapDistributeBase_H
125 label constructSize_;
137 bool constructHasFlip_;
154 const label expectedSize,
155 const label receivedSize
234 template<
class T,
class CombineOp,
class NegateOp>
246 const CombineOp& cop,
248 const NegateOp& negOp
253 template<
class T,
class NegateOp>
265 const NegateOp& negOp
270 template<
class T,
class NegateOp>
280 const NegateOp& negOp
301 void calcCompactDataRequirements
303 const bitSet& allowedLocalElems,
304 const bitSet& allowedRemoteElems,
320 void calcCompactLocalDataRequirements
322 const bitSet& allowedLocalElems,
337 void calcCompactRemoteDataRequirements
339 const bitSet& allowedRemoteElems,
356 const label localSize = -1
366 const bool doRenumber
378 static void renumberVisitOrder
447 const
int tag =
UPstream::msgType(),
461 const
int tag =
UPstream::msgType(),
552 return constructSize_;
558 return constructSize_;
576 return constructMap_;
582 return constructMap_;
600 return constructHasFlip_;
606 return constructHasFlip_;
618 return constructMap_.size();
652 const
UPstream::commsTypes commsType
670 const
List<
Map<label>>& compactMap,
671 const label globalElement
704 const label localSize,
706 const
Map<label>& cMap,
714 const label localSize,
716 const
Map<label>& cMap,
740 const
bitSet& allowedLocalElems,
741 const
int tag =
UPstream::msgType(),
742 const
bool doRenumber = false
759 const
bitSet& allowedRemoteElems,
760 const
int tag =
UPstream::msgType(),
761 const
bool doRenumber = false
786 const
bitSet& allowedLocalElems,
789 const label localSize = -1,
811 const
bitSet& allowedRemoteElems,
814 const label localSize = -1,
836 const label localSize = -1,
859 const label localSize = -1,
879 const label localSize = -1,
894 template<class
T, class CombineOp, class NegateOp>
897 const
UPstream::commsTypes commsType,
906 const CombineOp& cop,
907 const NegateOp& negOp,
908 const
int tag =
UPstream::msgType(),
920 template<class
T, class CombineOp, class NegateOp>
923 const
UPstream::commsTypes commsType,
935 const CombineOp& cop,
936 const NegateOp& negOp,
938 const
int tag =
UPstream::msgType(),
947 template<class
T, class NegateOp>
950 const
UPstream::commsTypes commsType,
958 const NegateOp& negOp,
959 const
int tag =
UPstream::msgType(),
989 const
UPstream::commsTypes commsType,
999 const
UPstream::commsTypes commsType,
1001 const
int tag =
UPstream::msgType()
1006 template<class
T, class NegateOp>
1010 const NegateOp& negOp,
1011 const
int tag =
UPstream::msgType()
1019 template<class
T, class NegateOp>
1022 const
UPstream::commsTypes commsType,
1024 const NegateOp& negOp,
1025 const
int tag =
UPstream::msgType()
1033 template<class
T, class NegateOp>
1036 const
UPstream::commsTypes commsType,
1039 const NegateOp& negOp,
1040 const
int tag =
UPstream::msgType()
1053 const
int tag =
UPstream::msgType()
1066 const
int tag =
UPstream::msgType()
1074 const
UPstream::commsTypes commsType,
1077 const
int tag =
UPstream::msgType()
1082 template<class
T, class NegateOp>
1085 const
UPstream::commsTypes commsType,
1088 const NegateOp& negOp,
1089 const
int tag =
UPstream::msgType()
1099 const
UPstream::commsTypes commsType,
1103 const
int tag =
UPstream::msgType()
1122 template<class
T, class negateOp>
1134 const negateOp& negOp,
1148 const
int tag =
UPstream::msgType()
1152 template<class
T, class CombineOp, class negateOp>
1161 const CombineOp& cop,
1162 const negateOp& negOp,
1174 const
int tag =
UPstream::msgType()
1237 const label localSize,
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Inter-processor communications stream.
static int & msgType() noexcept
Message tag of standard messages.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
A range or interval of labels defined by a start and a size.
Central-differencing interpolation scheme class.
Class containing processor-to-processor mapping information.
friend Ostream & operator<<(Ostream &, const mapDistributeBase &)
Write plain content (not dictionary) to Ostream.
mapDistributeBase() noexcept
Default construct (uses worldComm).
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.
const List< labelPair > & whichSchedule(const UPstream::commsTypes commsType) const
Return real or dummy schedule depending on the communication type.
bool & constructHasFlip() noexcept
Does constructMap include a sign.
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.
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.
const List< labelPair > & schedule() const
Return a schedule. Demand driven. See above.
void send(PstreamBuffers &pBufs, const UList< T > &field) const
Do all sends using PstreamBuffers.
void printLayout(Ostream &os) const
Debug: print layout. Can only be used on maps with sorted.
const labelListList & constructMap() const noexcept
From subsetted data to new reconstructed data.
ClassName("mapDistributeBase")
void transfer(mapDistributeBase &rhs)
Transfer the contents of the argument and annul the argument.
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.
static List< labelPair > schedule(const labelListList &subMap, const labelListList &constructMap, const int tag, const label comm=UPstream::worldComm)
Calculate a communication schedule. See above.
label nMaps() const noexcept
The number of sub-lists within the maps.
bool constructHasFlip() const noexcept
Does constructMap include a sign.
static List< T > accessAndFlip(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.
const labelListList & subMap() const noexcept
From subsetted data back to original data.
void calcCompactAddressing(const globalIndex &globalNumbering, const labelUList &elements, List< Map< label > > &compactMap) const
Construct per processor compact addressing of the global elements.
void readDict(const dictionary &dict)
Read entries from dictionary format.
friend Istream & operator>>(Istream &, mapDistributeBase &)
Read plain content (not dictionary) from Istream.
void writeEntries(Ostream &os) const
Write entries in dictionary format.
static void checkReceivedSize(const label proci, const label expectedSize, const label receivedSize)
Fatal if expected != received size.
bool subHasFlip() const noexcept
Does subMap include a sign.
labelList constructMapSizes() const
The sizes of the constructMap lists.
void receive(PstreamBuffers &pBufs, List< T > &field) const
Do all receives using PstreamBuffers.
void exchangeAddressing(const int tag, const globalIndex &globalNumbering, labelList &elements, List< Map< label > > &compactMap, labelList &compactStart)
static label renumber(const globalIndex &, const label comm, const List< Map< label > > &compactMap, const label globalElement)
Helper for construct from globalIndex. Renumbers element.
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).
labelList subMapSizes() const
The sizes of the subMap lists.
static label countUnmapped(const labelUList &elements, const labelListList &maps, const bool hasFlip)
Count the number of unmapped elements.
bool & subHasFlip() noexcept
Does subMap include a sign.
static label getMappedSize(const labelListList &maps, const bool hasFlip)
Scan the maps for the max addressed index.
void compact(const boolList &remoteElemUsed, const int tag=UPstream::msgType())
OpenFOAM-v2112 and earlier naming for compactRemoteData() using boolList.
labelListList & subMap() noexcept
From subsetted data back to original data.
label comm() const noexcept
The communicator used.
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.
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.
void clear()
Reset to zero size, only retaining communicator.
void updateMesh(const mapPolyMesh &)
No correction for topo change.
static bool hasFlipAddressing(const labelUList &map)
Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as po...
label subMapTotalSize() const noexcept
The sum of the subMap list sizes.
InfoProxy< mapDistributeBase > info() const noexcept
Return info proxy, used to print summary information to a stream.
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.
label & constructSize() noexcept
Constructed data size.
label constructMapTotalSize() const noexcept
The sum of the constructMap list sizes.
layoutTypes
The map layout (eg, of the constructMap).
@ localFirst
Local processor first, others in linear order.
labelListList & constructMap() noexcept
From subsetted data to new reconstructed data.
label constructSize() const noexcept
Constructed data size.
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.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
OBJstream os(runTime.globalPath()/outputName)
Pair< label > labelPair
A pair of labels.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values within a list.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
List< bool > boolList
A List of bools.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)