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"
11 #include "LocalTraceCollector.hxx"
12 #endif /* ifdef _DEBUG_*/
14 using namespace MEDMEM;
15 using namespace MED_EN;
19 LocalTraceCollector::instance();
20 #endif /* ifdef _DEBUG_*/
22 const char * fromFileName = "fromMesh.med";
23 const char * toFileName = "toMesh.med";
24 //const char * fieldName = "fieldcelldoublevector";
25 const char * fieldName = "fieldnodedouble";
27 const char * fromMeshName = "fromMesh";
28 const char * toMeshName = "toMesh";
32 cout<<"Lecture du Maillage Source : "<<flush; MESH fromMesh (MED_DRIVER,fromFileName,fromMeshName); cout<<"OK !"<<endl;
33 //cout<<"Construction du support : "<<flush; SUPPORT fromSupport (&fromMesh,"XsupportX",MED_CELL); cout<<"OK !"<<endl;
34 cout<<"Construction du support : "<<flush; SUPPORT fromSupport (&fromMesh,"XsupportX",MED_NODE); cout<<"OK !"<<endl;
35 cout<<"Lecture du champ : "<<flush; FIELD<double> fromField (&fromSupport,MED_DRIVER,fromFileName,fieldName); cout<<"OK !"<<endl;
36 cout<<"Lecture du Mailllage Cible : "<<flush; MESH toMesh (MED_DRIVER,toFileName,toMeshName); cout<<"OK !"<<endl;
38 INTERPOLATION<3> myInter (fromField,toMesh);
40 //FIELD<double> * toField = myInter.interpolate(0,1);
41 FIELD<double> * toField = myInter.interpolate(1,1);
43 cout<<"Creation du driver"<<endl;
45 toField->addDriver(MED_DRIVER,toFileName,toField->getName()) ;
47 cout<<"toField->getName() = "<<toField->getName() <<endl;
48 cout<<"toField->getDescription() = "<<toField->getDescription() <<endl;
49 cout<<"toField->getNumberOfComponents() = "<<toField->getNumberOfComponents() <<endl;
50 cout<<"toField->getNumberOfValues() = "<<toField->getNumberOfValues() <<endl;
51 cout<<"toField->getComponentsNames() = "<<toField->getComponentsNames() <<endl;
52 cout<<"toField->getComponentsDescriptions() = "<<toField->getComponentsDescriptions()<<endl;
53 cout<<"toField->getMEDComponentsUnits() = "<<toField->getMEDComponentsUnits() <<endl;
54 cout<<"toField->getIterationNumber() = "<<toField->getIterationNumber() <<endl;
55 cout<<"toField->getTime() = "<<toField->getTime() <<endl;
56 cout<<"toField->getOrderNumber() = "<<toField->getOrderNumber() <<endl;
57 cout<<"toField->getValueType() = "<<toField->getValueType() <<endl;
63 } catch (MEDEXCEPTION& ex){