Version: 9.16.0
MEDCoupling::StructuredCoincidentDEC Class Reference

#include <StructuredCoincidentDEC.hxx>

Inheritance diagram for MEDCoupling::StructuredCoincidentDEC:
Collaboration diagram for MEDCoupling::StructuredCoincidentDEC:

Public Member Functions

void prepareSourceDE ()
 
void prepareTargetDE ()
 
void recvData ()
 
void release ()
 
void sendData ()
 
 StructuredCoincidentDEC ()
 
 StructuredCoincidentDEC (ProcessorGroup &source, ProcessorGroup &target)
 
void synchronize ()
 
virtual ~StructuredCoincidentDEC ()
 
- Public Member Functions inherited from MEDCoupling::DisjointDEC
void attachLocalField (const ICoCo::MEDDoubleField *field)
 
void attachLocalField (const ParaFIELD *field, bool ownPt=false)
 
void attachLocalField (MEDCouplingFieldDouble *field)
 
virtual void computeProcGroup ()
 
 DisjointDEC ()
 
 DisjointDEC (const DisjointDEC &)
 
 DisjointDEC (const std::set< int > &src_ids, const std::set< int > &trg_ids, const MPI_Comm &world_comm=MPI_COMM_WORLD)
 
 DisjointDEC (ProcessorGroup &source_group, ProcessorGroup &target_group)
 
DisjointDECoperator= (const DisjointDEC &s)
 
virtual void prepareSourceDE ()=0
 
virtual void prepareTargetDE ()=0
 
virtual void recvData ()=0
 
void renormalizeTargetField (bool isWAbs)
 
virtual void sendData ()=0
 
void sendRecvData (bool way=true)
 
void setNature (NatureOfField nature)
 
virtual void synchronize ()=0
 
virtual ~DisjointDEC ()
 

Additional Inherited Members

- Protected Member Functions inherited from MEDCoupling::DisjointDEC
void cleanInstance ()
 
void compareFieldAndMethod () const
 
- Protected Attributes inherited from MEDCoupling::DisjointDEC
const ParaFIELD_local_field
 
bool _owns_field
 

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

◆ StructuredCoincidentDEC() [1/2]

MEDCoupling::StructuredCoincidentDEC::StructuredCoincidentDEC ( )

◆ StructuredCoincidentDEC() [2/2]

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

◆ ~StructuredCoincidentDEC()

MEDCoupling::StructuredCoincidentDEC::~StructuredCoincidentDEC ( )
virtual

References release().

Member Function Documentation

◆ release()

void MEDCoupling::StructuredCoincidentDEC::release ( )

Destructor involves MPI operations: make sure this is accessible from a proper method for Python wrapping.

References MEDCoupling::DisjointDEC::cleanInstance().

Referenced by ~StructuredCoincidentDEC().

◆ synchronize()

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 prepareSourceDE(), and prepareTargetDE().

◆ recvData()

◆ sendData()

void MEDCoupling::StructuredCoincidentDEC::sendData ( )
virtual

◆ prepareSourceDE()

◆ prepareTargetDE()