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