1 #include "MEDMEM_Exception.hxx"
2 #include "MEDMEM_define.hxx"
4 #include "MEDMEM_Field.hxx"
5 #include "MEDMEM_Mesh.hxx"
6 #include "MEDMEM_Interpolation.hxx"
10 using namespace MEDMEM;
11 using namespace MED_EN;
15 const char * fromFileName = "fromMesh.med";
16 const char * toFileName = "toMesh.med";
17 const char * fieldName = "fieldnodedouble";
19 const char * fromMeshName = "fromMesh";
20 const char * toMeshName = "toMesh";
22 const int flagConvex = 1;
23 const int interpolationType = 1;
27 MESH fromMesh (MED_DRIVER,fromFileName,fromMeshName);
28 SUPPORT fromSupport (&fromMesh,"XsupportX",MED_NODE);
29 FIELD<double> fromField (&fromSupport,MED_DRIVER,fromFileName,fieldName);
30 MESH toMesh (MED_DRIVER,toFileName,toMeshName);
32 INTERPOLATION<3> myInter (fromField,toMesh);
34 FIELD<double> * toField = myInter.interpolate(interpolationType,flagConvex);
36 toField->addDriver(MED_DRIVER,toFileName,toField->getName()) ;
41 } catch (MEDEXCEPTION& ex){