]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/test_copie_mesh.cxx
Salome HOME
remove a reference to the $MED_ROOT_DIR in the Makefile.in wich is useless
[modules/med.git] / src / MEDMEM / test_copie_mesh.cxx
1 #include<string>
2
3 #include <math.h>
4 #include <stdlib.h>
5
6 #include "MEDMEM_Exception.hxx"
7 #include "MEDMEM_Mesh.hxx"
8 #include "MEDMEM_Family.hxx"
9 #include "MEDMEM_Group.hxx"
10
11 #include "MEDMEM_MedMeshDriver.hxx"
12 #include "MEDMEM_MedFieldDriver.hxx"
13 #include "MEDMEM_Support.hxx"
14 #include "MEDMEM_Field.hxx"
15 #include "MEDMEM_define.hxx"
16
17 #ifdef _DEBUG_
18 #include "LocalTraceCollector.hxx"
19 #endif /* ifdef _DEBUG_*/
20
21 using namespace std;
22 using namespace MEDMEM;
23
24 int main (int argc, char ** argv) {
25 #ifdef _DEBUG_
26   LocalTraceCollector::instance();
27 #endif /* ifdef _DEBUG_*/
28
29   int read;
30
31   if (argc <3) { // after 3, ignored !
32     cerr << "Usage : " << argv[0] 
33          << " filename meshname" << endl << endl;
34     exit(-1);
35   }
36
37   string filename = argv[1] ;
38   string meshname = argv[2] ;
39
40   MESH * myMesh= new MESH() ;
41   myMesh->setName(meshname);
42   MED_MESH_RDONLY_DRIVER myMeshDriver(filename,myMesh) ;
43   myMeshDriver.setMeshName(meshname);
44   myMeshDriver.open() ;
45   myMeshDriver.read() ;
46   myMeshDriver.close() ;
47
48   cout << * myMesh << endl;
49   MESH * myMesh2 = new MESH(* myMesh);
50   delete myMesh;
51   cout << * myMesh2 << endl;
52   delete myMesh2;
53
54   return 0;
55 }