Back to index

salome-med  6.5.0
Functions
test_copie_mesh.cxx File Reference
#include <string>
#include <math.h>
#include <stdlib.h>
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_Family.hxx"
#include "MEDMEM_Group.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
#include "MEDMEM_MedFieldDriver.hxx"
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 41 of file test_copie_mesh.cxx.

                                  {

  if (argc <3) { // after 3, ignored !
    cerr << "Usage : " << argv[0] 
         << " filename meshname" << endl << endl;
    exit(-1);
  }

  string filename = argv[1] ;
  string meshname = argv[2] ;

  MESH * myMesh= new MESH;
  myMesh->setName(meshname);
  MED_MESH_RDONLY_DRIVER myMeshDriver(filename,myMesh) ;
  myMeshDriver.setMeshName(meshname);
  myMeshDriver.open() ;
  myMeshDriver.read() ;
  myMeshDriver.close() ;

  cout << * myMesh << endl;
  MESH * myMesh2 = new MESH(* myMesh);
  myMesh->removeReference();
  cout << * myMesh2 << endl;
  myMesh2->removeReference();

  return 0;
}