74#ifndef Foam_mapDistributeBase_H
75#define Foam_mapDistributeBase_H
96class mapDistributeBase;
98Istream&
operator>>(Istream&, mapDistributeBase&);
99Ostream&
operator<<(Ostream&,
const mapDistributeBase&);
111 label constructSize_;
123 bool constructHasFlip_;
140 const label expectedSize,
141 const label receivedSize
218 template<
class T,
class CombineOp,
class NegateOp>
224 const CombineOp& cop,
225 const NegateOp& negOp,
231 template<
class T,
class NegateOp>
237 const NegateOp& negOp
242 template<
class T,
class NegateOp>
248 const NegateOp& negOp
269 void calcCompactDataRequirements
271 const bitSet& allowedLocalElems,
272 const bitSet& allowedRemoteElems,
288 void calcCompactLocalDataRequirements
290 const bitSet& allowedLocalElems,
305 void calcCompactRemoteDataRequirements
307 const bitSet& allowedRemoteElems,
324 const label localSize = -1
334 const bool doRenumber
346 static void renumberVisitOrder
488 return constructSize_;
494 return constructSize_;
512 return constructMap_;
518 return constructMap_;
536 return constructHasFlip_;
542 return constructHasFlip_;
554 return constructMap_.
size();
600 const label globalElement
639 const bitSet& allowedLocalElems,
641 const bool doRenumber =
false
658 const bitSet& allowedRemoteElems,
660 const bool doRenumber =
false
685 const bitSet& allowedLocalElems,
688 const label localSize = -1,
710 const bitSet& allowedRemoteElems,
713 const label localSize = -1,
735 const label localSize = -1,
758 const label localSize = -1,
778 const label localSize = -1,
790 template<
class T,
class NegateOp>
801 const NegateOp& negOp,
810 template<
class T,
class CombineOp,
class NegateOp>
822 const CombineOp& cop,
823 const NegateOp& negOp,
849 template<
class T,
class NegateOp>
853 const NegateOp& negOp,
862 template<
class T,
class NegateOp>
867 const NegateOp& negOp,
876 template<
class T,
class NegateOp>
882 const NegateOp& negOp,
923 template<
class T,
class NegateOp>
929 const NegateOp& negOp,
1013 const label localSize,
1024Ostream&
operator<<(Ostream&
os,
const InfoProxy<mapDistributeBase>& ip);
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 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).
void size(const label n)
Older name for setAddressableSize.
commsTypes
Types of communications.
static int & msgType() noexcept
Message tag of standard messages.
static label worldComm
Default communicator (all processors)
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 unique integer (label so might not have enough room - 2G max) for processor + local inde...
Class containing processor-to-processor mapping information.
friend Ostream & operator<<(Ostream &, const mapDistributeBase &)
Write plain content (not dictionary) to Ostream.
void operator=(const mapDistributeBase &rhs)
Copy assignment.
const List< labelPair > & whichSchedule(const UPstream::commsTypes commsType) const
bool & constructHasFlip() noexcept
Does constructMap include a sign.
void compactRemoteData(const bitSet &allowedRemoteElems, const int tag=UPstream::msgType(), const bool doRenumber=false)
static List< T > accessAndFlip(const UList< T > &values, const labelUList &indices, const bool hasFlip, const NegateOp &negOp)
static label renumberMap(labelListList &mapElements, const labelUList &oldToNew, const bool hasFlip)
const List< labelPair > & schedule() const
Return a schedule. Demand driven. See above.
mapDistributeBase()
Default construct (uses worldComm)
void send(PstreamBuffers &pBufs, const List< 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
static label renumber(const globalIndex &, const List< Map< label > > &compactMap, const label globalElement)
Helper for construct from globalIndex. Renumbers element.
label nMaps() const noexcept
The number of sub-lists within the maps.
bool constructHasFlip() const noexcept
Does constructMap include a sign.
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.
static void flipAndCombine(const labelUList &map, const bool hasFlip, const UList< T > &rhs, const CombineOp &cop, const NegateOp &negOp, List< T > &lhs)
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 and received size are not equal.
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 T accessAndFlip(const UList< T > &values, const label index, const bool hasFlip, const NegateOp &negOp)
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())
labelListList & subMap() noexcept
From subsetted data back to original data.
label comm() const noexcept
The communicator used.
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)
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute data with specified negate operator (for flips).
static void unionCombineMasks(UList< bitSet > &sendMasks, UList< bitSet > &recvMasks, const int tag, const label comm)
label & constructSize() noexcept
Constructed data size.
InfoProxy< mapDistributeBase > info() const
Info proxy to print summary information to a stream.
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)
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)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)