FreeFOAM The Cross-Platform CFD Toolkit
mapDistribute Class Reference

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

#include <OpenFOAM/mapDistribute.H>


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 send on one processor have to equal the number of items received on the other processor.

Source files

Definition at line 66 of file mapDistribute.H.

List of all members.

Public Member Functions

 mapDistribute (const label constructSize, const labelListList &subMap, const labelListList &constructMap)
 Construct from components.
 mapDistribute (const label constructSize, labelListList &subMap, labelListList &constructMap, const bool reUse)
 (optionally destructively) construct from components
 mapDistribute (const labelList &sendProcs, const labelList &recvProcs)
 Construct from reverse addressing: per data item the send.
 mapDistribute (const mapDistribute &)
 Construct copy.
label constructSize () const
 Constructed data size.
label & constructSize ()
 Constructed data size.
const labelListListsubMap () const
 From subsetted data back to original data.
labelListListsubMap ()
 From subsetted data back to original data.
const labelListListconstructMap () const
 From subsetted data to new reconstructed data.
labelListListconstructMap ()
 From subsetted data to new reconstructed data.
const List< labelPair > & schedule () const
 Return a schedule. Demand driven. See above.
void compact (const boolList &elemIsUsed)
 Compact maps. Gets per field a bool whether it is used (locally)
template<class T >
void distribute (List< T > &fld) const
 Distribute data using default commsType.
void updateMesh (const mapPolyMesh &)
 Correct for topo change.
void operator= (const mapDistribute &)

Static Public Member Functions

static List< labelPairschedule (const labelListList &subMap, const labelListList &constructMap)
 Calculate a schedule. See above.
template<class T >
static void distribute (const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const labelListList &constructMap, List< T > &)
 Distribute data. Note:schedule only used for Pstream::scheduled.
template<class T , class CombineOp >
static void distribute (const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const labelListList &constructMap, List< T > &, const CombineOp &cop, const T &nullValue)
 Distribute data. If multiple processors writing to same.

Constructor & Destructor Documentation

mapDistribute ( const label  constructSize,
const labelListList subMap,
const labelListList constructMap 
)

Construct from components.

Definition at line 172 of file mapDistribute.C.

mapDistribute ( const label  constructSize,
labelListList subMap,
labelListList constructMap,
const bool  reUse 
)

(optionally destructively) construct from components

Definition at line 187 of file mapDistribute.C.

mapDistribute ( const labelList sendProcs,
const labelList recvProcs 
)

Construct from reverse addressing: per data item the send.

processor and the receive processor. All processors get same data.

Definition at line 202 of file mapDistribute.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, Pstream::myProcNo(), Pstream::nProcs(), List< T >::setSize(), and List< T >::size().

mapDistribute ( const mapDistribute map)

Construct copy.

Definition at line 275 of file mapDistribute.C.


Member Function Documentation

label& constructSize ( )
inline

Constructed data size.

Definition at line 127 of file mapDistribute.H.

labelListList& subMap ( )
inline

From subsetted data back to original data.

Definition at line 139 of file mapDistribute.H.

labelListList& constructMap ( )
inline

From subsetted data to new reconstructed data.

Definition at line 151 of file mapDistribute.H.

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

Return a schedule. Demand driven. See above.

Definition at line 152 of file mapDistribute.C.

References autoPtr< T >::empty(), and autoPtr< T >::reset().

Referenced by mapDistribute::distribute().

void compact ( const boolList elemIsUsed)

Compact maps. Gets per field a bool whether it is used (locally)

and works out itself what this side and sender side can remove from maps.

Definition at line 286 of file mapDistribute.C.

References UList< T >::begin(), forAll, Foam::max(), Pstream::myProcNo(), PstreamBase::nonBlocking, Pstream::nProcs(), IPstream::read(), List< T >::setSize(), List< T >::size(), IPstream::waitRequests(), OPstream::waitRequests(), and OPstream::write().

void distribute ( const Pstream::commsTypes  commsType,
const List< labelPair > &  schedule,
const label  constructSize,
const labelListList subMap,
const labelListList constructMap,
List< T > &  field,
const CombineOp &  cop,
const T nullValue 
)
static

Distribute data. If multiple processors writing to same.

position adds contributions using cop.

Definition at line 334 of file mapDistributeTemplates.C.

References Foam::abort(), UList< T >::begin(), Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, List< T >::setSize(), List< T >::size(), T, and List< T >::transfer().

void distribute ( List< T > &  fld) const
inline
void updateMesh ( const mapPolyMesh )
inline

Correct for topo change.

Definition at line 250 of file mapDistribute.H.

References notImplemented.

void operator= ( const mapDistribute rhs)

Definition at line 426 of file mapDistribute.C.

References Foam::abort(), List< T >::clear(), Foam::FatalError, and FatalErrorIn.


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