Salome HOME
Building a version which will be tagged PreV2_0_0 working with KERNEL V1_4_0.
[modules/med.git] / doc / MEDMEM / MEDMEM_MedAddingAnExistingObject.cxx
1 #include "MEDMEM_Exception.hxx"
2 #include "MEDMEM_define.hxx"
3
4 #include "MEDMEM_Field.hxx"
5 #include "MEDMEM_Mesh.hxx"
6 #include "MEDMEM_Med.hxx"
7
8 main () {
9   
10   const char * fileName   = "pointe.med";
11   const char * fileName2  = "Field&MeshGeneratedPointe.med";
12   const char * fileName3  = "MedGeneratedPointe.med";
13   const char * fieldName1  = "fieldcelldouble";
14   const char * fieldName2  = "fieldcelldoublebis";
15   const char * meshName1   = "maa1";
16   const char * meshName2   = "maa1bis";
17
18   try {
19
20     // FAIRE LE TEST AVEC LES CHAMPS AUSSI !.
21
22     MESH myMesh(MED_DRIVER,fileName,meshName1);
23     myMesh.setName(meshName2);
24     myMesh.rmDriver();
25
26     MED  myMed(MED_DRIVER,fileName);
27     myMed.read();
28     myMed.addMesh(&myMesh);
29     int myMedDriver = myMed.addDriver(MED_DRIVER,fileName3);
30     myMed.write(myMedDriver);
31
32     // FAIRE LE TEST AVEC LES CHAMPS AUSSI !.
33
34   } catch (MEDEXCEPTION& ex){
35     MESSAGE(ex.what()) ;
36   }
37 }