]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/test_MEDMEM_CellModel.cxx
Salome HOME
remove a reference to the $MED_ROOT_DIR in the Makefile.in wich is useless
[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 #ifdef _DEBUG_
6 #include "LocalTraceCollector.hxx"
7 #endif /* ifdef _DEBUG_*/
8
9 using namespace std;
10 using namespace MEDMEM;
11 using namespace MED_EN;
12
13 int main (int argc, char ** argv) {
14 #ifdef _DEBUG_
15   LocalTraceCollector::instance();
16 #endif /* ifdef _DEBUG_*/
17
18   list<medGeometryElement> geomList = meshEntities[MED_CELL] ;
19   list<medGeometryElement>::iterator itGeomList ;
20   for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
21     CELLMODEL myCellModel((MED_EN::medGeometryElement)(*itGeomList)) ;
22
23     cout << "First CellModel :" << endl << endl ;
24
25     cout << myCellModel << endl ;
26
27     cout << "Number of constituents type : "<<myCellModel.getNumberOfConstituentsType() << endl ;
28
29     set <medGeometryElement> geomType = myCellModel.getAllConstituentsType() ;
30     set <medGeometryElement>::iterator geomTypeIt ;
31     cout << "Types list : " ;
32     for(geomTypeIt=geomType.begin();geomTypeIt!=geomType.end();geomTypeIt++)
33       cout << (*geomTypeIt) << " " ;
34     cout << endl;
35     
36     map <medGeometryElement,int> myMap = myCellModel.getNumberOfConstituentsForeachType() ; 
37     map <medGeometryElement,int>::iterator myMapIt ;
38     for(myMapIt=myMap.begin();myMapIt!=myMap.end();myMapIt++)
39       cout << " - " << (*myMapIt).second << " constituent(s) of type " << (*myMapIt).first << endl ;
40     cout << endl;
41
42     cout << "Second CellModel :" << endl << endl ;
43     CELLMODEL myCellModel2=myCellModel ;
44     cout << myCellModel2 << endl ;
45
46     cout << "Third CellModel :" << endl << endl ;
47     CELLMODEL myCellModel3 ;
48     myCellModel3=myCellModel ;
49     cout << myCellModel3 << endl ;
50   }
51 }