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 :
MEDMEM_REMAPPER.prepare() method.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
...
| MEDMEM_REMAPPER::MEDMEM_REMAPPER | ( | ) | [inherited] |
| MEDMEM_REMAPPER::~MEDMEM_REMAPPER | ( | ) | [virtual, inherited] |
| int MEDMEM_REMAPPER::prepare | ( | const MEDMEM::MESH & | mesh_source, |
| const MEDMEM::MESH & | mesh_target, | ||
| const char * | method | ||
| ) | [inherited] |
This method computes the intersection matrix between source mesh_source and mesh_target. It is a preliminary step that is necessary before calling the transfer() method. The method analyses the dimensions of the meshes and checks for compatibility.
References MEDMEM_REMAPPER._deno_multiply, MEDMEM_REMAPPER._deno_reverse_multiply, MEDMEM_REMAPPER._matrix, MEDMEM_REMAPPER._nb_cols, MEDMEM_REMAPPER._nb_rows, MEDMEM_REMAPPER._sourceFieldType, MEDMEM_REMAPPER._sourceMesh, MEDMEM_REMAPPER._sourceSupport, MEDMEM_REMAPPER._targetFieldType, MEDMEM_REMAPPER._targetMesh, MEDMEM_REMAPPER._targetSupport, INTERP_KERNEL.Matrix< T, type >.colSum(), MEDMEM.MESH.getMeshDimension(), MEDMEM.GMESH.getSpaceDimension(), INTERP_KERNEL.Interpolation3D.interpolateMeshes(), INTERP_KERNEL.InterpolationPlanar< RealPlanar >.interpolateMeshes(), MED_EN.MED_CELL, MED_EN.MED_NODE, testRenumbering.method, MEDMEM.RCBASE.removeReference(), and INTERP_KERNEL.Matrix< T, type >.rowSum().
| void MEDMEM_REMAPPER::transfer | ( | const MEDMEM::FIELD< double > & | source_field, |
| MEDMEM::FIELD< double > & | target_field | ||
| ) | [inherited] |
References MEDMEM_REMAPPER._deno_multiply, MEDMEM_REMAPPER._matrix, MEDMEM_REMAPPER._nb_cols, MEDMEM_REMAPPER._nb_rows, MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getNumberOfValues(), INTERP_KERNEL.InterpolationOptions.getPrecision(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), and INTERP_KERNEL.Matrix< T, type >.multiply().
| void MEDMEM_REMAPPER::reverseTransfer | ( | MEDMEM::FIELD< double > & | source_field, |
| const MEDMEM::FIELD< double > & | target_field | ||
| ) | [inherited] |
References MEDMEM_REMAPPER._deno_reverse_multiply, MEDMEM_REMAPPER._matrix, MEDMEM_REMAPPER._nb_cols, MEDMEM_REMAPPER._nb_rows, MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getNumberOfValues(), INTERP_KERNEL.InterpolationOptions.getPrecision(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), and INTERP_KERNEL.Matrix< T, type >.transposeMultiply().
| MEDMEM::FIELD< double > * MEDMEM_REMAPPER::transferField | ( | const MEDMEM::FIELD< double > & | source_field | ) | [inherited] |
References MEDMEM_REMAPPER._deno_multiply, MEDMEM_REMAPPER._matrix, MEDMEM_REMAPPER._nb_cols, MEDMEM_REMAPPER._nb_rows, MEDMEM_REMAPPER._targetSupport, MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getNumberOfValues(), INTERP_KERNEL.InterpolationOptions.getPrecision(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), and INTERP_KERNEL.Matrix< T, type >.multiply().
| MEDMEM::FIELD< double > * MEDMEM_REMAPPER::reverseTransferField | ( | const MEDMEM::FIELD< double > & | target_field | ) | [inherited] |
References MEDMEM_REMAPPER._deno_reverse_multiply, MEDMEM_REMAPPER._matrix, MEDMEM_REMAPPER._nb_cols, MEDMEM_REMAPPER._nb_rows, MEDMEM_REMAPPER._sourceSupport, MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getNumberOfValues(), INTERP_KERNEL.InterpolationOptions.getPrecision(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), and INTERP_KERNEL.Matrix< T, type >.transposeMultiply().
Reimplemented from INTERP_KERNEL.InterpolationOptions.
Reimplemented from INTERP_KERNEL.InterpolationOptions.
| int MEDMEM_REMAPPER::setOptionString | ( | const std::string & | key, |
| std::string & | value | ||
| ) | [inherited] |
| MEDMEM::FIELD< double > * MEDMEM_REMAPPER::getSupportVolumes | ( | const MEDMEM::SUPPORT & | support | ) | [private, inherited] |
returns the volumes of the cells underlying the support support
For 2D geometries, the returned field contains the areas. For 3D geometries, the returned field contains the volumes.
| support | : support whose cell volumes are required |
References MEDMEM.GMESH.getArea(), MEDMEM.SUPPORT.getMesh(), MEDMEM.GMESH.getMeshDimension(), MEDMEM.GMESH.getVolume(), and MED_test2.mesh.
| void MEDMEM_REMAPPER::printMatrixInfo | ( | ) | [inherited] |
References MEDMEM_REMAPPER._matrix.