Go to the documentation of this file.
73 #ifndef mapDistributeBase_H
74 #define mapDistributeBase_H
94 class mapDistributeBase;
96 Istream&
operator>>(Istream&, mapDistributeBase&);
97 Ostream&
operator<<(Ostream&,
const mapDistributeBase&);
137 const label expectedSize,
138 const label receivedSize
175 template<
class T,
class CombineOp,
class negateOp>
181 const CombineOp& cop,
182 const negateOp& negOp,
186 template<
class T,
class negateOp>
192 const negateOp& negOp
366 const label globalElement
384 const label localSize,
393 template<
class T,
class negateOp>
404 const negateOp& negOp,
411 template<
class T,
class CombineOp,
class negateOp>
423 const CombineOp& cop,
424 const negateOp& negOp,
438 template<
class T,
class negateOp>
442 const negateOp& negOp,
void reverseDistribute(const label constructSize, List< T > &, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
static T accessAndFlip(const UList< T > &fld, const label index, const bool hasFlip, const negateOp &negOp)
const labelListList & subMap() const
From subsetted data back to original data.
bool constructHasFlip() const
Does constructMap include a sign.
labelListList subMap_
Maps from subsetted data back to original data.
friend Istream & operator>>(Istream &, mapDistributeBase &)
Read dictionary from Istream.
friend Ostream & operator<<(Ostream &, const mapDistributeBase &)
Write dictionary to Ostream.
labelListList & constructMap()
From subsetted data to new reconstructed data.
static label renumber(const globalIndex &, const List< Map< label >> &compactMap, const label globalElement)
Helper for construct from globalIndex. Renumbers element.
void operator=(const mapDistributeBase &rhs)
Copy assignment.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void send(PstreamBuffers &, const List< T > &) const
Do all sends using PstreamBuffers.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void receive(PstreamBuffers &, List< T > &) const
Do all receives using PstreamBuffers.
Istream & operator>>(Istream &, directionInfo &)
static void flipAndCombine(const labelUList &map, const bool hasFlip, const UList< T > &rhs, const CombineOp &cop, const negateOp &negOp, List< T > &lhs)
void transfer(mapDistributeBase &rhs)
Transfer the contents of the argument and annul the argument.
bool & subHasFlip()
Does subMap include a sign.
autoPtr< List< labelPair > > schedulePtr_
Schedule.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
mapDistributeBase(const label comm=UPstream::worldComm)
Construct null.
label comm_
Communicator to use for parallel operations.
const List< labelPair > & schedule() const
Return a schedule. Demand driven. See above.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute data. Note:schedule only used for.
void calcCompactAddressing(const globalIndex &globalNumbering, const labelUList &elements, List< Map< label >> &compactMap) const
Construct per processor compact addressing of the global elements.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label constructSize_
Size of reconstructed data.
static void checkReceivedSize(const label proci, const label expectedSize, const label receivedSize)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool subHasFlip_
Whether subMap includes flip or not.
OBJstream os(runTime.globalPath()/outputName)
bool subHasFlip() const
Does subMap include a sign.
bool constructHasFlip_
Whether constructMap includes flip or not.
void compact(const boolList &elemIsUsed, const int tag=UPstream::msgType())
Compact maps. Gets per field a bool whether it is used (locally)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void printLayout(Ostream &os) const
Debug: print layout. Can only be used on maps with sorted.
void exchangeAddressing(const int tag, const globalIndex &globalNumbering, labelList &elements, List< Map< label >> &compactMap, labelList &compactStart)
label constructSize() const
Constructed data size.
commsTypes
Types of communications.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
labelListList constructMap_
Maps from subsetted data to new reconstructed data.
static int & msgType() noexcept
Message tag of standard messages.
static label worldComm
Default communicator (all processors)
labelListList & subMap()
From subsetted data back to original data.
label & constructSize()
Constructed data size.
bool & constructHasFlip()
Does constructMap include a sign.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Class containing processor-to-processor mapping information.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const labelListList & constructMap() const
From subsetted data to new reconstructed data.
void updateMesh(const mapPolyMesh &)
Correct for topo change.
ClassName("mapDistributeBase")