Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / USERD_get_nfaced_conn.H
blobfedfcdd6351846028124a11dd8018f4bf95bd826
2 int USERD_get_nfaced_conn
4     int part_number,
5     int *nfaced_conn_array
8 #ifdef ENSIGHTDEBUG
9     Info << "Entering: USERD_get_nfaced_conn"
10         << ", part_number = " << part_number
11         << endl
12         << flush;
13 #endif
15     if (part_number == 1)
16     {
17         label nPoint = 0;
18         const cellShapeList& cellShapes = meshPtr->cellShapes();
19         const cellList& cells = meshPtr->cells();
20         const faceList& faces = meshPtr->faces();
21         label nCells = cellShapes.size();
23         for (label n=0; n<nCells; n++)
24         {
25             label nFacesInCell = cells[n].size();
26             labelList points = cellShapes[n];
27             if ((nFacesInCell == 6) && (points.size() == 8))
28             {}
29             else if ((nFacesInCell == 4) && (points.size() == 4))
30             {}
31             else if (nFacesInCell == 5)
32             {
33                 if (points.size() == 6)
34                 {}
35                 else if (points.size() == 5)
36                 {}
37                 else
38                 {
39                     for(label i=0; i<nFacesInCell; i++)
40                     {
41                         label facei = cells[n][i];
42                         label nPoints = faces[facei].size();
43                         for(label j=0; j<nPoints; j++)
44                         {
45                             nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
46                         }
47                     }
48                 }
49             }
50             else
51             {
52                 for(label i=0; i<nFacesInCell; i++)
53                 {
54                     label facei = cells[n][i];
55                     label nPoints = faces[facei].size();
56                     for(label j=0; j<nPoints; j++)
57                     {
58                         nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
59                     }
60                 }
61             }
62         }
64     }
65     else if (part_number < nPatches+2)
66     {
68     }
69     else if (sprayPtr && part_number == nPatches+2)
70     {
71         return Z_ERR;
72     }
73     else if
74     (
75         secondMeshPtr
76      && part_number == secondMeshPartNum
77     )
78     {
79         label nPoint = 0;
80         const cellShapeList& cellShapes = secondMeshPtr->cellShapes();
81         const cellList& cells = secondMeshPtr->cells();
82         const faceList& faces = secondMeshPtr->faces();
83         label nCells = cellShapes.size();
85         for (label n=0; n<nCells; n++)
86         {
87             label nFacesInCell = cells[n].size();
88             labelList points = cellShapes[n];
89             if ((nFacesInCell == 6) && (points.size() == 8))
90             {}
91             else if ((nFacesInCell == 4) && (points.size() == 4))
92             {}
93             else if (nFacesInCell == 5)
94             {
95                 if (points.size() == 6)
96                 {}
97                 else if (points.size() == 5)
98                 {}
99                 else
100                 {
101                     for(label i=0; i<nFacesInCell; i++)
102                     {
103                         label facei = cells[n][i];
104                         label nPoints = faces[facei].size();
105                         for(label j=0; j<nPoints; j++)
106                         {
107                             nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
108                         }
109                     }
110                 }
111             }
112             else
113             {
114                 for(label i=0; i<nFacesInCell; i++)
115                 {
116                     label facei = cells[n][i];
117                     label nPoints = faces[facei].size();
118                     for(label j=0; j<nPoints; j++)
119                     {
120                         nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
121                     }
122                 }
123             }
124         }
125     }
126     else if
127     (
128         secondMeshPtr
129      && part_number <= secondMeshPartNum + nSecondMeshPatches
130     )
131     {
132     }
133     else if
134     (
135         faMeshPtr
136      && part_number == Numparts_available
137     )
138     {
139     }
140     else
141     {
142         return Z_ERR;
143     }
145 #ifdef ENSIGHTDEBUG
146     Info << "Exiting: USERD_get_nfaced_conn" << endl
147         << flush;
148 #endif
149     return Z_OK;