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) |
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.
The following code excerpt illutrates a typical use of the InterpKernelDEC class.
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 : , with
the field on the target side and
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 :
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();
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.
source_group | working side ProcessorGroup |
target_group | lazy 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 |
||
) |
|
virtual |
|
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 :
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().
|
virtual |
Receives the data whether the processor is on the working side or on the lazy side. It must match a sendData() call on the other side.
Implements ParaMEDMEM::DisjointDEC.
References ParaMEDMEM::DisjointDEC::_local_field, ParaMEDMEM::DisjointDEC::_source_group, ParaMEDMEM::DisjointDEC::_target_group, ParaMEDMEM::ParaFIELD::getField(), INTERP_KERNEL::InterpolationOptions::getMeasureAbsStatus(), ParaMEDMEM::InterpolationMatrix::multiply(), ParaMEDMEM::DisjointDEC::renormalizeTargetField(), and ParaMEDMEM::InterpolationMatrix::transposeMultiply().
Referenced by ParaMEDMEM::InterpKernelDEC::recvData().
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.
time | time at which the value is desired |
References ParaMEDMEM::InterpolationMatrix::getAccessDEC(), and ParaMEDMEM::InterpKernelDEC::recvData().
|
virtual |
Sends the data whether the processor is on the working side or on the lazy side. It must match a recvData() call on the other side.
Implements ParaMEDMEM::DisjointDEC.
References ParaMEDMEM::DisjointDEC::_local_field, ParaMEDMEM::DisjointDEC::_source_group, ParaMEDMEM::DisjointDEC::_target_group, ParaMEDMEM::ParaFIELD::getField(), INTERP_KERNEL::InterpolationOptions::getMeasureAbsStatus(), ParaMEDMEM::InterpolationMatrix::multiply(), ParaMEDMEM::DisjointDEC::renormalizeTargetField(), and ParaMEDMEM::InterpolationMatrix::transposeMultiply().
Referenced by ParaMEDMEM::InterpKernelDEC::sendData().
void ParaMEDMEM::InterpKernelDEC::sendData | ( | double | time, |
double | deltatime | ||
) |
Sends the data available at time time in asynchronous mode.
time | time at which the value is available |
deltatime | time interval between the value presently sent and the next one. |
References ParaMEDMEM::InterpolationMatrix::getAccessDEC(), and ParaMEDMEM::InterpKernelDEC::sendData().