Version: 6.5.0
Functions
InterpKernelDEC

Functions

 ParaMEDMEM::InterpKernelDEC::InterpKernelDEC ()
 ParaMEDMEM::InterpKernelDEC::InterpKernelDEC (ProcessorGroup &source_group, ProcessorGroup &target_group)
 ParaMEDMEM::InterpKernelDEC::InterpKernelDEC (const std::set< int > &src_ids, const std::set< int > &trg_ids, const MPI_Comm &world_comm=MPI_COMM_WORLD)
virtual ParaMEDMEM::InterpKernelDEC::~InterpKernelDEC ()
void ParaMEDMEM::InterpKernelDEC::synchronize ()
void ParaMEDMEM::InterpKernelDEC::recvData ()
void ParaMEDMEM::InterpKernelDEC::recvData (double time)
void ParaMEDMEM::InterpKernelDEC::sendData ()
void ParaMEDMEM::InterpKernelDEC::sendData (double time, double deltatime)

Detailed Description

Overview

The InterpKernelDEC enables the conservativeremapping of fields between two parallel codes. This remapping is based on the computation of intersection volumes between elements from code A and elements from code B. The computation is possible for 3D meshes, 2D meshes, and 3D-surface meshes. Dimensions must be similar for code A and code B (for instance, though it could be desirable, it is not yet possible to couple 3D surfaces with 2D surfaces).

In the present version, only fields lying on elements are considered.

NonCoincident_small.png
Example showing the transfer from a field based on a quadrangular mesh to a triangular mesh. In a P0-P0 interpolation, to obtain the value on a triangle, the values on quadrangles are weighted by their intersection area and summed.
A typical use of InterpKernelDEC encompasses two distinct phases :

The following code excerpt illutrates a typical use of the InterpKernelDEC class.

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

A conservativeremapping of the field from the source mesh to the target mesh is performed by the function synchronise(), which computes the remappingmatrix.

Computing the field on the receiving side can be expressed in terms of a matrix-vector product : $ \phi_t=W.\phi_s$, with $ \phi_t $ the field on the target side and $ \phi_s $ the field on the source side. When remapping a 3D surface to another 3D surface, a projection phase is necessary to match elements from both sides. Care must be taken when defining this projection to obtain a conservative remapping.

In the P0-P0 case, this matrix is a plain rectangular matrix with coefficients equal to the intersection areas between triangle and quadrangles. For instance, in the above figure, the matrix is :

\[ \begin{tabular}{|cccc|} 0.72 & 0 & 0.2 & 0 \\ 0.46 & 0 & 0.51 & 0.03\\ 0.42 & 0.53 & 0 & 0.05\\ 0 & 0 & 0.92 & 0.05 \\ \end{tabular} \]

Options

On top of DEC Options, options supported by InterpKernelDEC objects are related to the underlying Intersector class. All the options available in the intersector objects are available for the InterpKernelDEC object. The various options available for * intersectors can be reviewed in Intersectors.

For instance :

InterpKernelDEC dec(source_group, target_group);
dec.attachLocalField(field);
dec.setOptions("DoRotate",false);
dec.setOptions("Precision",1e-12);
dec.synchronize();
Warning
{ Options must be set before calling the synchronize method. }

Function Documentation

ParaMEDMEM::InterpKernelDEC::InterpKernelDEC ( )
ParaMEDMEM::InterpKernelDEC::InterpKernelDEC ( ProcessorGroup &  source_group,
ProcessorGroup &  target_group 
)

This constructor creates an InterpKernelDEC which has source_group as a working side and target_group as an idle side. All the processors will actually participate, but intersection computations will be performed on the working side during the synchronize() phase. The constructor must be called synchronously on all processors of both processor groups.

Parameters
source_groupworking side ProcessorGroup
target_grouplazy side ProcessorGroup
ParaMEDMEM::InterpKernelDEC::InterpKernelDEC ( const std::set< int > &  src_ids,
const std::set< int > &  trg_ids,
const MPI_Comm &  world_comm = MPI_COMM_WORLD 
)
ParaMEDMEM::InterpKernelDEC::~InterpKernelDEC ( )
virtual
void ParaMEDMEM::InterpKernelDEC::synchronize ( )
virtual

Synchronization process for exchanging topologies.

This method prepares all the structures necessary for sending data from a processor group to the other. It uses the mesh underlying the fields that have been set with attachLocalField method. It works in four steps :

  1. Bounding boxes are computed for each subdomain,
  2. The lazy side mesh parts that are likely to intersect the working side local processor are sent to the working side,
  3. The working side calls the interpolation kernel to compute the intersection between local and imported mesh.
  4. The lazy side is updated so that it knows the structure of the data that will be sent by the working side during a sendData() call.

Implements ParaMEDMEM::DisjointDEC.

References ParaMEDMEM::DisjointDEC::_local_field, ParaMEDMEM::DisjointDEC::_source_group, ParaMEDMEM::DisjointDEC::_target_group, ParaMEDMEM::DisjointDEC::_union_group, ParaMEDMEM::InterpolationMatrix::addContribution(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::InterpolationMatrix::finishContributionL(), ParaMEDMEM::InterpolationMatrix::finishContributionW(), ParaMEDMEM::DisjointDEC::isInUnion(), and ParaMEDMEM::InterpolationMatrix::prepare().

void ParaMEDMEM::InterpKernelDEC::recvData ( )
virtual
void ParaMEDMEM::InterpKernelDEC::recvData ( double  time)

Receives the data at time time in asynchronous mode. The value of the field will be time-interpolated from the field values received.

Parameters
timetime at which the value is desired

References ParaMEDMEM::InterpolationMatrix::getAccessDEC(), and ParaMEDMEM::InterpKernelDEC::recvData().

void ParaMEDMEM::InterpKernelDEC::sendData ( )
virtual
void ParaMEDMEM::InterpKernelDEC::sendData ( double  time,
double  deltatime 
)

Sends the data available at time time in asynchronous mode.

Parameters
timetime at which the value is available
deltatimetime interval between the value presently sent and the next one.

References ParaMEDMEM::InterpolationMatrix::getAccessDEC(), and ParaMEDMEM::InterpKernelDEC::sendData().

Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS