Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / USERD_get_nfaced_conn.H
blob436d68d2591796cf55892afdc489faf3f8f97cd4
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
70     {
71         return Z_ERR;
72     }
74 #ifdef ENSIGHTDEBUG
75     Info<< "Exiting: USERD_get_nfaced_conn" << endl
76         << flush;
77 #endif
78     return Z_OK;