Back to index

salome-med  6.5.0
MEDMEM::MEDMEM_REMAPPER

Overview

MEDMEM_REMAPPER enables conservative remapping of fields between two sequential codes. The computation is possible for 3D meshes and 2D meshes or 3D surfaces. It enables fast sequential localization, based on a bounding box tree structure. It is based on cell-cell intersection or on a point in element search, depending on the field type. Fields can either lie on cells (P0) or nodes (P1).

A typical use of MEDMEM_REMAPPER encompasses two distinct phases :

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

    ...
    std::string sourceFileName("source.med");
    MEDMEM::MESH med_source_mesh(MED_DRIVER,sourceFileName,"Source_Mesh");
    std::string targetFileName("target.med");
    MEDMEM::MESH med_target_mesh(MED_DRIVER,targetFileName,"Target_Mesh");
    FIELD<double> sourceField(MED_DRIVER,sourceFileName,"Density",0,0);
    FIELD<double> targetField;
    MEDMEM_Remapper mapper;
    mapper.setOptionsDouble("Precision",1e-7);
    mapper.setOptionsString("Intersection_type",Geometric2D);
    mapper.prepare(med_source_mesh,med_target_mesh,"P0P1");
    mapper.transfer(sourceField,targetField);
    //use targetField
    ...