Salome HOME
DCQ : Merge with Ecole Ete a6.
[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 using namespace MEDMEM;
7 int main (int argc, char ** argv) {
8   list<MED_FR::med_geometrie_element> geomList = MED_FR::meshEntities[MED_FR::MED_MAILLE] ;
9   list<MED_FR::med_geometrie_element>::iterator itGeomList ;
10   for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
11     CELLMODEL myCellModel((MED_EN::medGeometryElement)(*itGeomList)) ;
12
13     cout << "First CellModel :" << endl << endl ;
14
15     cout << myCellModel << endl ;
16
17     cout << "Number of constituents type : "<<myCellModel.getNumberOfConstituentsType() << endl ;
18
19     set <medGeometryElement> geomType = myCellModel.getAllConstituentsType() ;
20     set <medGeometryElement>::iterator geomTypeIt ;
21     cout << "Types list : " ;
22     for(geomTypeIt=geomType.begin();geomTypeIt!=geomType.end();geomTypeIt++)
23       cout << (*geomTypeIt) << " " ;
24     cout << endl;
25     
26     map <medGeometryElement,int> myMap = myCellModel.getNumberOfConstituentsForeachType() ; 
27     map <medGeometryElement,int>::iterator myMapIt ;
28     for(myMapIt=myMap.begin();myMapIt!=myMap.end();myMapIt++)
29       cout << " - " << (*myMapIt).second << " constituent(s) of type " << (*myMapIt).first << endl ;
30     cout << endl;
31
32     cout << "Second CellModel :" << endl << endl ;
33     CELLMODEL myCellModel2=myCellModel ;
34     cout << myCellModel2 << endl ;
35
36     cout << "Third CellModel :" << endl << endl ;
37     CELLMODEL myCellModel3 ;
38     myCellModel3=myCellModel ;
39     cout << myCellModel3 << endl ;
40   }
41 }