Back to index

salome-med  6.5.0
Functions
test_copie_group.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

static void affiche_support (const SUPPORT *mySupport)
static void affiche_groupe (const GROUP *myGroup)
int main (int argc, char **argv)

Function Documentation

static void affiche_groupe ( const GROUP *  myGroup) [static]

Definition at line 65 of file test_copie_group.cxx.

{
    affiche_support(myGroup);
    int NumberOfFamillies = myGroup->getNumberOfFamilies() ;
    cout << "  - Families ("<<NumberOfFamillies<<") :"<<endl;
    for (int j=1;j<NumberOfFamillies+1;j++)
      cout << "    * "<<myGroup->getFamily(j)->getName().c_str()<<endl ;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void affiche_support ( const SUPPORT *  mySupport) [static]

Definition at line 42 of file test_copie_group.cxx.

{
  cout << "  - Name : "<<mySupport->getName().c_str()<<endl ;
  cout << "  - Description : "<<mySupport->getDescription().c_str()<<endl ;
  cout << "  - Entity : "<<mySupport->getEntity()<<endl ;
  cout << "  - Entities list : "<<endl ;
  if (!(mySupport->isOnAllElements())) {
    int NumberOfTypes = mySupport->getNumberOfTypes() ;
    cout<<"  - NumberOfTypes : "<<NumberOfTypes<<endl;
    const medGeometryElement * Types = mySupport->getTypes() ;
    for (int j=0;j<NumberOfTypes;j++) {
      cout<<"    * Type "<<Types[j]<<" : ";
      int NumberOfElements = mySupport->getNumberOfElements(Types[j]) ;
      const int * Number = mySupport->getNumber(Types[j]) ;
      for (int k=0; k<NumberOfElements;k++)
        cout << Number[k] << " ";
      cout << endl ;
    }
  } else
    cout << "    Is on all entities !"<< endl;
}

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 74 of file test_copie_group.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() ;

  const GROUP * myGroup = myMesh->getGroup(MED_NODE,1);
  cout << "Show Group :"<<endl ;
  affiche_groupe(myGroup);
  GROUP * myGroup2 = new GROUP(* myGroup);
  affiche_groupe(myGroup2);
  GROUP * myGroup3 = new GROUP(* myGroup2);
  myGroup2->removeReference();
  affiche_groupe(myGroup3);
  myGroup3->removeReference();

  myMesh->removeReference() ;

  return 0;
}

Here is the call graph for this function: