Salome HOME
merging the main trunk with the BrForComp branch to build a pre V3_0_1
[modules/med.git] / src / MEDMEM / test_MEDMEM_PolyConnectivity.cxx
1 // This program test the implementation of the class CONNECTIVITY for Polygons and Polyhedron. //
2
3 #include "MEDMEM_Connectivity.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(void)
14 {
15 #ifdef _DEBUG_
16   LocalTraceCollector::instance();
17 #endif /* ifdef _DEBUG_*/
18
19   CONNECTIVITY myNodalConnectivity;
20   CONNECTIVITY myDescendingConnectivity;
21
22   //POLYGONS
23   const med_int NumberOfPolygons = 2;
24   const med_int ConnectivitySize = 12;
25   med_int PolygonsConnectivityIndex[NumberOfPolygons+1] = {1,7,13};
26
27   //Nodal
28   med_int PolygonsNodalConnectivity[ConnectivitySize] = {1,2,3,4,5,10,10,5,6,7,8,9};
29
30   myNodalConnectivity.setPolygonsConnectivity(MED_NODAL,MED_CELL,PolygonsNodalConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons);
31
32   //Descending
33   med_int PolygonsDescendingConnectivity[ConnectivitySize] = {1,2,3,4,11,10,11,5,6,7,8,9};
34
35   myDescendingConnectivity.setPolygonsConnectivity(MED_DESCENDING,MED_CELL,PolygonsDescendingConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons);
36
37   //POLYHEDRON
38   const med_int NumberOfPolyhedron = 2;
39   med_int PolyhedronIndex[NumberOfPolyhedron+1] = {1,10,20};
40
41   //Nodal
42   const med_int NumberOfFaces = 19;
43   const med_int NumberOfNodes = 74;
44   med_int PolyhedronFacesIndex[NumberOfFaces+1] = {1,7,11,15,19,23,27,31,34,39,44,48,52,55,58,61,64,68,72,75};
45   med_int PolyhedronNodalConnectivity[NumberOfNodes] = {1,2,3,4,5,6,1,7,8,2,2,8,9,3,4,3,9,10,5,4,10,11,6,5,11,12,1,6,12,7,7,12,8,10,9,8,12,11,13,14,15,3,2,13,2,8,16,14,13,16,17,15,14,17,15,17,18,15,18,9,3,15,9,2,3,9,8,8,9,17,16,9,18,17};
46
47   myNodalConnectivity.setPolyhedronConnectivity(MED_NODAL,PolyhedronNodalConnectivity,PolyhedronIndex,NumberOfNodes,NumberOfPolyhedron,PolyhedronFacesIndex,NumberOfFaces);
48
49   //Descending
50   const med_int DescendingConnectivitySize = 19;
51   med_int PolyhedronDescendingConnectivity[DescendingConnectivitySize] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,3,17,18};
52
53   myDescendingConnectivity.setPolyhedronConnectivity(MED_DESCENDING,PolyhedronDescendingConnectivity,PolyhedronIndex,DescendingConnectivitySize,NumberOfPolyhedron);
54
55   cout << myNodalConnectivity;
56   cout << myDescendingConnectivity;
57
58   return 0;
59 }