Public Member Functions | |
InterpKernelDEC () | |
InterpKernelDEC (ProcessorGroup &source_group, ProcessorGroup &target_group) | |
InterpKernelDEC (const std::set< int > &src_ids, const std::set< int > &trg_ids, const MPI_Comm &world_comm=MPI_COMM_WORLD) | |
void | prepareSourceDE () |
void | prepareTargetDE () |
void | recvData () |
void | recvData (double time) |
void | sendData () |
void | sendData (double time, double deltatime) |
void | synchronize () |
virtual | ~InterpKernelDEC () |
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) | |
ProcessorGroup * | getSourceGrp () const |
ProcessorGroup * | getTargetGrp () const |
bool | isInSourceSide () const |
bool | isInTargetSide () const |
bool | isInUnion () const |
DisjointDEC & | operator= (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) |
Public Member Functions inherited from INTERP_KERNEL::InterpolationOptions | |
void | copyOptions (const InterpolationOptions &other) |
std::string | filterInterpolationMethod (const std::string &meth) const |
double | getArcDetectionPrecision () const |
double | getBoundingBoxAdjustment () const |
double | getBoundingBoxAdjustmentAbs () const |
bool | getDoRotate () const |
IntersectionType | getIntersectionType () const |
std::string | getIntersectionTypeRepr () const |
double | getMaxDistance3DSurfIntersect () const |
bool | getMeasureAbsStatus () const |
double | getMedianPlane () const |
double | getMinDotBtwPlane3DSurfIntersect () const |
int | getOrientation () const |
double | getPrecision () const |
int | getPrintLevel () const |
SplittingPolicy | getSplittingPolicy () const |
std::string | getSplittingPolicyRepr () const |
void | init () |
InterpolationOptions () | |
std::string | printOptions () const |
void | setArcDetectionPrecision (double p) |
void | setBoundingBoxAdjustment (double bba) |
void | setBoundingBoxAdjustmentAbs (double bba) |
void | setDoRotate (bool dr) |
bool | setInterpolationOptions (long print_level, std::string intersection_type, double precision, double median_plane, bool do_rotate, double bounding_box_adjustment, double bounding_box_adjustment_abs, double max_distance_for_3Dsurf_intersect, long orientation, bool measure_abs, std::string splitting_policy) |
void | setIntersectionType (IntersectionType it) |
void | setMaxDistance3DSurfIntersect (double bba) |
void | setMeasureAbsStatus (bool newStatus) |
void | setMedianPlane (double mp) |
void | setMinDotBtwPlane3DSurfIntersect (double v) |
bool | setOptionDouble (const std::string &key, double value) |
bool | setOptionInt (const std::string &key, int value) |
bool | setOptionString (const std::string &key, const std::string &value) |
void | setOrientation (int o) |
void | setPrecision (double p) |
void | setPrintLevel (int pl) |
void | setSplittingPolicy (SplittingPolicy sp) |
Additional Inherited Members | |
Static Public Member Functions inherited from INTERP_KERNEL::InterpolationOptions | |
static void | CheckAndSplitInterpolationMethod (const std::string &method, std::string &srcMeth, std::string &trgMeth) |
Static Public Attributes inherited from INTERP_KERNEL::InterpolationOptions | |
static const char | ARC_DETECTION_PRECISION_STR [] ="ArcDetectionPrecision" |
static const char | BARYCENTRIC_INTERSECT_STR [] ="Barycentric" |
static const char | BARYCENTRICGEO2D_INTERSECT_STR [] ="BarycentricGeo2D" |
static const char | BOUNDING_BOX_ADJ_ABS_STR [] ="BoundingBoxAdjustmentAbs" |
static const char | BOUNDING_BOX_ADJ_STR [] ="BoundingBoxAdjustment" |
static const char | CONVEX_INTERSECT2D_STR [] ="Convex" |
static const char | DO_ROTATE_STR [] ="DoRotate" |
static const char | GENERAL_SPLIT_24_STR [] ="GENERAL_24" |
static const char | GENERAL_SPLIT_48_STR [] ="GENERAL_48" |
static const char | GEOMETRIC_INTERSECT2D_STR [] ="Geometric2D" |
static const char | INTERSEC_TYPE_STR [] ="IntersectionType" |
static const char | MAX_DISTANCE_3DSURF_INSECT_STR [] ="MaxDistance3DSurfIntersect" |
static const char | MEASURE_ABS_STR [] ="MeasureAbs" |
static const char | MEDIANE_PLANE_STR [] ="MedianPlane" |
static const char | MIN_DOT_BTW_3DSURF_INSECT_STR [] ="MinDotBetween3DSurfIntersect" |
static const char | ORIENTATION_STR [] ="Orientation" |
static const char | PLANAR_SPLIT_FACE_5_STR [] ="PLANAR_FACE_5" |
static const char | PLANAR_SPLIT_FACE_6_STR [] ="PLANAR_FACE_6" |
static const char | POINTLOCATOR_INTERSECT_STR [] ="PointLocator" |
static const char | PRECISION_STR [] ="Precision" |
static const char | PRINT_LEV_STR [] ="PrintLevel" |
static const char | SPLITTING_POLICY_STR [] ="SplittingPolicy" |
static const char | TRIANGULATION_INTERSECT2D_STR [] ="Triangulation" |
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 |
The InterpKernelDEC enables the remapping (or interpolation) of fields between two parallel codes.
The projection methodology is based on the algorithms of INTERP_KERNEL, that is to say, they work in a similar fashion than what the sequential remapper does. The following projection methods are supported: P0->P0 (the most common case), P1->P0, P0->P1.
The computation is possible for 3D meshes, 2D meshes, and 3D-surface meshes. Dimensions must be identical 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).
The name "InterpKernelDEC" comes from the fact that this class uses exactly the same algorithms as the sequential remapper. Both this class and the sequential MEDCouplingRemapper are built on top of the INTERP_KERNEL algorithms (notably the computation of the intersection volumes).
Among the important properties inherited from the parent abstract class DisjointDEC, the two processor groups (source and target) must have a void intersection.
.
In the figure above we see the transfer of a field based on a quadrangular mesh to a new field supported by a triangular mesh. In a P0-P0 interpolation, to obtain the value on a triangle, the values on the quadrangles are weighted by their intersection area and summed.A typical use of InterpKernelDEC encompasses two distinct phases :
The following code excerpt illustrates a typical use of the InterpKernelDEC class.
A remapping of the field from the source mesh to the target mesh is performed by the function synchronise(), which computes the interpolation matrix.
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 the usual DEC options, the 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 and point locators.
For instance :
InterpKernelDEC dec(source_group, target_group); dec.attachLocalField(field); dec.setDoRotate(false); dec.setPrecision(1e-12); dec.synchronize();
MEDCoupling::InterpKernelDEC::InterpKernelDEC | ( | ) |
MEDCoupling::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. The source group and target group MUST form a partition of all the procs within the communicator passed as 'world_comm' when building the group.
source_group | working side ProcessorGroup |
target_group | lazy side ProcessorGroup |
MEDCoupling::InterpKernelDEC::InterpKernelDEC | ( | const std::set< int > & | src_ids, |
const std::set< int > & | trg_ids, | ||
const MPI_Comm & | world_comm = MPI_COMM_WORLD |
||
) |
Creates an InterpKernelDEC from a set of source procs IDs and target group IDs. The difference with the ctor using groups is that the set of procs might not cover entirely MPI_COMM_WORLD (a sub-communicator holding the union of source and target procs is recreated internally).
|
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 MEDCoupling::DisjointDEC.
References MEDCoupling::DisjointDEC::_local_field, MEDCoupling::DECOptions::_method, MEDCoupling::DisjointDEC::_source_group, MEDCoupling::DisjointDEC::_target_group, MEDCoupling::DisjointDEC::_union_group, MEDCoupling::InterpolationMatrix::addContribution(), MEDCoupling::ProcessorGroup::containsMyRank(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::InterpolationMatrix::finishContributionL(), MEDCoupling::InterpolationMatrix::finishContributionW(), MEDCoupling::DisjointDEC::isInUnion(), MEDCoupling::InterpolationMatrix::prepare(), MEDCoupling::ProcessorGroup::size(), and MEDCoupling::ProcessorGroup::translateRank().
|
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 MEDCoupling::DisjointDEC.
References MEDCoupling::DisjointDEC::_local_field, MEDCoupling::DisjointDEC::_source_group, MEDCoupling::DisjointDEC::_target_group, MEDCoupling::ProcessorGroup::containsMyRank(), MEDCoupling::ParaFIELD::getField(), MEDCoupling::DECOptions::getForcedRenormalization(), INTERP_KERNEL::InterpolationOptions::getMeasureAbsStatus(), MEDCoupling::InterpolationMatrix::multiply(), MEDCoupling::DisjointDEC::renormalizeTargetField(), and MEDCoupling::InterpolationMatrix::transposeMultiply().
Referenced by recvData().
void MEDCoupling::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 MEDCoupling::InterpolationMatrix::getAccessDEC(), and 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 MEDCoupling::DisjointDEC.
References MEDCoupling::DisjointDEC::_local_field, MEDCoupling::DisjointDEC::_source_group, MEDCoupling::DisjointDEC::_target_group, MEDCoupling::ProcessorGroup::containsMyRank(), MEDCoupling::ParaFIELD::getField(), MEDCoupling::DECOptions::getForcedRenormalization(), INTERP_KERNEL::InterpolationOptions::getMeasureAbsStatus(), MEDCoupling::InterpolationMatrix::multiply(), MEDCoupling::DisjointDEC::renormalizeTargetField(), and MEDCoupling::InterpolationMatrix::transposeMultiply().
Referenced by sendData().
void MEDCoupling::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 MEDCoupling::InterpolationMatrix::getAccessDEC(), and sendData().
|
virtual |
Implements MEDCoupling::DisjointDEC.
|
virtual |
Implements MEDCoupling::DisjointDEC.