2 \page dualmesh DualMESH
4 The \ref INTERP_KERNEL::DualMESH "DualMESH" class is an auxiliary class used to perform P0->P1
5 interpolation in \ref interpkernel. It takes place of target mesh in
6 interpolation process and is initialized by the target mesh.
8 DualMESH inherits from MEDMEM::MESH. It's API consists of only a
9 constructor with one argument of the input target MEDMEM::MESH.
11 The dual mesh is a polygonal mesh in 2D space or polyhedral mesh in 3D space
12 consisting of dual cells built around each node of input target mesh.
14 In 2D the dual cell is bound by edges connecting barycentres of cells
15 sharing the input node with middles of cell edges ending at the input node.
17 In 3D the dual polyhedron is bound by triangle faces. Each triangle is built
18 on three following points:
19 - barycentre of a cell sharing the input node;
20 - barycentre of a face bounding the cell and sharing the input node;
21 - middle of an edge bounding the face and ending at the input node.
23 \section DualMESHUsage DualMESH usage
25 An exemple of DualMESH usage to perform P0->P1 interpolation with INTERP_KERNEL::Remapper :
29 std::string sourceFileName("source.med");
30 MEDMEM::MESH med_source_mesh(MED_DRIVER,sourceFileName,"Source_Mesh");
31 std::string targetFileName("target.med");
32 MEDMEM::MESH med_target_mesh(MED_DRIVER,targetFileName,"Target_Mesh");
33 FIELD<double> sourceField(MED_DRIVER,sourceFileName,"Density",0,0);
34 FIELD<double> targetField;
36 mapper.prepare(med_source_mesh, DualMESH(med_target_mesh), "P0P1"); //<--- DualMESH
37 mapper.transfer(sourceField,targetField);