Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::StructuredCoincidentDEC Class Reference
Inheritance diagram for MEDCoupling::StructuredCoincidentDEC:
Collaboration diagram for MEDCoupling::StructuredCoincidentDEC:

Public Member Functions

void prepareSourceDE ()
 
void prepareTargetDE ()
 
void recvData ()
 
void sendData ()
 
 StructuredCoincidentDEC ()
 
 StructuredCoincidentDEC (ProcessorGroup &source, ProcessorGroup &target)
 
void synchronize ()
 
virtual ~StructuredCoincidentDEC ()
 
- Public Member Functions inherited from MEDCoupling::DisjointDEC
void attachLocalField (MEDCouplingFieldDouble *field)
 
void attachLocalField (const ParaFIELD *field, bool ownPt=false)
 
void attachLocalField (const ICoCo::MEDField *field)
 
virtual void computeProcGroup ()
 
 DisjointDEC ()
 
 DisjointDEC (ProcessorGroup &source_group, ProcessorGroup &target_group)
 
 DisjointDEC (const DisjointDEC &)
 
 DisjointDEC (const std::set< int > &src_ids, const std::set< int > &trg_ids, const MPI_Comm &world_comm=MPI_COMM_WORLD)
 
ProcessorGroupgetSourceGrp () const
 
ProcessorGroupgetTargetGrp () const
 
bool isInSourceSide () const
 
bool isInTargetSide () const
 
bool isInUnion () const
 
DisjointDECoperator= (const DisjointDEC &s)
 
void renormalizeTargetField (bool isWAbs)
 
void sendRecvData (bool way=true)
 
void setNature (NatureOfField nature)
 
virtual ~DisjointDEC ()
 
- Public Member Functions inherited from MEDCoupling::DEC
void copyFrom (const DEC &other)
 
 DEC ()
 
virtual ~DEC ()
 
- Public Member Functions inherited from MEDCoupling::DECOptions
 DECOptions ()
 
 DECOptions (const DECOptions &deco)
 
AllToAllMethod getAllToAllMethod () const
 
bool getAsynchronous () const
 
bool getForcedRenormalization () const
 
const std::string & getMethod () const
 
TimeInterpolationMethod getTimeInterpolationMethod () const
 
void setAllToAllMethod (AllToAllMethod sp)
 
void setAsynchronous (bool dr)
 
void setForcedRenormalization (bool dr)
 
void setMethod (const char *m)
 
void setTimeInterpolationMethod (TimeInterpolationMethod it)
 

Additional Inherited Members

- Protected Member Functions inherited from MEDCoupling::DisjointDEC
void checkPartitionGroup () const
 
void cleanInstance ()
 
void compareFieldAndMethod () const throw (INTERP_KERNEL::Exception)
 
void copyInstance (const DisjointDEC &other)
 
- Protected Attributes inherited from MEDCoupling::DisjointDEC
const CommInterface_comm_interface
 
const ParaFIELD_local_field
 
bool _owns_field
 
bool _owns_groups
 
ProcessorGroup_source_group
 
ProcessorGroup_target_group
 
MPI_Comm _union_comm
 
ProcessorGroup_union_group
 

Detailed Description

This class aims at remapping fields that have identical structured supports (=the same underlying mesh) but different parallel topologies (=different sub-domains in the structured mesh). It can be used to couple together multi-physics codes that operate on the same domain with different partitioning. This can be useful for example if one of the computation is much faster than the other. It can also be used to couple together codes that share an interface that was generated in the same manner (with identical global ids). Also, this DEC can be used for fields that have component topologies, i.e., components that are scattered over several processors.

The remapping between the two supports is based on identity of global ids, instead of geometrical considerations (as it is the case for InterpKernelDEC). Therefore, beware that this DEC can not be used for coincident meshes if they do not have the exact same numbering.

With this DEC no projection, and no interpolation of the field data is done, contrary to what happens in InterpKernelDEC. It is just a matter of allocating the values from one side to the other, using directly the cell identifiers.

As all the other DECs, its usage requires two phases :

  • a setup phase during which the topologies are exchanged so that the target side knows from which processors it should expect the data.
  • a send/recv phase during which the field data is actually transferred.

This example illustrates the sending of a field with the StructuredCoincidentDEC :

...
StructuredCoincidentDEC dec(groupA, groupB);
dec.attachLocalField(field);
dec.synchronize();
if (groupA.containsMyRank())
dec.recvData();
else if (groupB.containsMyRank())
dec.sendData();
...

Creating a ParaFIELD to be attached to the DEC is done in exactly the same way as for the other DECs, if only the partitioning of the support mesh differs. In the case where the fields have also different component topologies, creating the ParaFIELD requires some more effort. See the parallelism section for more details.

Constructor & Destructor Documentation

MEDCoupling::StructuredCoincidentDEC::StructuredCoincidentDEC ( )
MEDCoupling::StructuredCoincidentDEC::StructuredCoincidentDEC ( ProcessorGroup source,
ProcessorGroup target 
)
MEDCoupling::StructuredCoincidentDEC::~StructuredCoincidentDEC ( )
virtual

Member Function Documentation

void MEDCoupling::StructuredCoincidentDEC::synchronize ( )
virtual

Prepares a DEC for data exchange

This method broadcasts the topologies from source to target so that the target side can analyse from which processors it is expected to receive data.

Implements MEDCoupling::DisjointDEC.

References MEDCoupling::DisjointDEC::_source_group, MEDCoupling::DisjointDEC::_target_group, MEDCoupling::ProcessorGroup::containsMyRank(), prepareSourceDE(), and prepareTargetDE().

void MEDCoupling::StructuredCoincidentDEC::sendData ( )
virtual