]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/test_MEDMEM_CellModel.cxx
Salome HOME
update from the MedMemory V1.0.1
[modules/med.git] / src / MEDMEM / test_MEDMEM_CellModel.cxx
1 using namespace std;
2 #include "utilities.h"
3 #include "MEDMEM_CellModel.hxx"
4 #include "MEDMEM_DriversDef.hxx"
5
6 int main (int argc, char ** argv) {
7   list<MED_FR::med_geometrie_element> geomList = MED_FR::meshEntities[MED_FR::MED_MAILLE] ;
8   list<MED_FR::med_geometrie_element>::iterator itGeomList ;
9   for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
10     CELLMODEL myCellModel((MED_EN::medGeometryElement)(*itGeomList)) ;
11
12     cout << "First CellModel :" << endl << endl ;
13
14     cout << myCellModel << endl ;
15
16     cout << "Number of constituents type : "<<myCellModel.getNumberOfConstituentsType() << endl ;
17
18     set <medGeometryElement> geomType = myCellModel.getAllConstituentsType() ;
19     set <medGeometryElement>::iterator geomTypeIt ;
20     cout << "Types list : " ;
21     for(geomTypeIt=geomType.begin();geomTypeIt!=geomType.end();geomTypeIt++)
22       cout << (*geomTypeIt) << " " ;
23     cout << endl;
24     
25     map <medGeometryElement,int> myMap = myCellModel.getNumberOfConstituentsForeachType() ; 
26     map <medGeometryElement,int>::iterator myMapIt ;
27     for(myMapIt=myMap.begin();myMapIt!=myMap.end();myMapIt++)
28       cout << " - " << (*myMapIt).second << " constituent(s) of type " << (*myMapIt).first << endl ;
29     cout << endl;
30
31     cout << "Second CellModel :" << endl << endl ;
32     CELLMODEL myCellModel2=myCellModel ;
33     cout << myCellModel2 << endl ;
34
35     cout << "Third CellModel :" << endl << endl ;
36     CELLMODEL myCellModel3 ;
37     myCellModel3=myCellModel ;
38     cout << myCellModel3 << endl ;
39   }
40 }