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;
14 const char * fromFileName = "fromMesh.med";
15 const char * toFileName = "toMesh.med";
16 const char * fieldName = "fieldnodedouble";
18 const char * fromMeshName = "fromMesh";
19 const char * toMeshName = "toMesh";
21 const int flagConvex = 1;
22 const int interpolationType = 1;
26 MESH fromMesh (MED_DRIVER,fromFileName,fromMeshName);
27 SUPPORT fromSupport (&fromMesh,"XsupportX",MED_NODE);
28 FIELD<double> fromField (&fromSupport,MED_DRIVER,fromFileName,fieldName);
29 MESH toMesh (MED_DRIVER,toFileName,toMeshName);
31 INTERPOLATION<3> myInter (fromField,toMesh);
33 FIELD<double> * toField = myInter.interpolate(interpolationType,flagConvex);
35 toField->addDriver(MED_DRIVER,toFileName,toField->getName()) ;
40 } catch (MEDEXCEPTION& ex){