Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[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 using namespace std;
6 using namespace MEDMEM;
7 using namespace MED_EN;
8
9 int main(void)
10 {
11   CONNECTIVITY myNodalConnectivity;
12   CONNECTIVITY myDescendingConnectivity;
13
14   //POLYGONS
15   const med_int NumberOfPolygons = 2;
16   const med_int ConnectivitySize = 12;
17   med_int PolygonsConnectivityIndex[NumberOfPolygons+1] = {1,7,13};
18
19   //Nodal
20   med_int PolygonsNodalConnectivity[ConnectivitySize] = {1,2,3,4,5,10,10,5,6,7,8,9};
21
22   myNodalConnectivity.setPolygonsConnectivity(MED_NODAL,MED_CELL,PolygonsNodalConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons);
23
24   //Descending
25   med_int PolygonsDescendingConnectivity[ConnectivitySize] = {1,2,3,4,11,10,11,5,6,7,8,9};
26
27   myDescendingConnectivity.setPolygonsConnectivity(MED_DESCENDING,MED_CELL,PolygonsDescendingConnectivity,PolygonsConnectivityIndex,ConnectivitySize,NumberOfPolygons);
28
29   //POLYHEDRON
30   const med_int NumberOfPolyhedron = 2;
31   med_int PolyhedronIndex[NumberOfPolyhedron+1] = {1,10,20};
32
33   //Nodal
34   const med_int NumberOfFaces = 19;
35   const med_int NumberOfNodes = 74;
36   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};
37   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};
38
39   myNodalConnectivity.setPolyhedronConnectivity(MED_NODAL,PolyhedronNodalConnectivity,PolyhedronIndex,NumberOfNodes,NumberOfPolyhedron,PolyhedronFacesIndex,NumberOfFaces);
40
41   //Descending
42   const med_int DescendingConnectivitySize = 19;
43   med_int PolyhedronDescendingConnectivity[DescendingConnectivitySize] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,3,17,18};
44
45   myDescendingConnectivity.setPolyhedronConnectivity(MED_DESCENDING,PolyhedronDescendingConnectivity,PolyhedronIndex,DescendingConnectivitySize,NumberOfPolyhedron);
46
47   cout << myNodalConnectivity;
48   cout << myDescendingConnectivity;
49
50   return 0;
51 }