BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / USERD_get_nsided_conn.H
blobd1d769d630f39349a7e52f04a388c323c2aee67c
2 int USERD_get_nsided_conn
4     int part_number,
5     int *nsided_conn_array
8 #ifdef ENSIGHTDEBUG
9     Info << "Entering: USERD_get_nsided_conn"
10         << ", part_number = " << part_number
11         << endl
12         << flush;
13 #endif
16     if (part_number == 1)
17     {
18         Info << "************* EEEEEEEEERRRRRRRRRRRRRRRRRR *************** " << endl << flush;
20     }
21     else if (part_number < nPatches+2)
22     {
23         //const cellList& cells = meshPtr->cells();
24         //const faceList& faces = meshPtr->faces();
26         label patchi = part_number - 2;
27         const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
29         label np = 0;
30         forAll(bMesh[patchi], facei)
31         {
32             label nPoints = bMesh[patchi][facei].size();
33             if ((nPoints != 3) && (nPoints != 4))
34             {
35                 for(label i=0; i<nPoints; i++)
36                 {
37                     nsided_conn_array[np++] = bMesh[patchi][facei][i] + 1;
38                 }
39             }
40         }
41     }
42     else if (sprayPtr && part_number == nPatches+2)
43     {
44         return Z_ERR;
45     }
46     else if
47     (
48         secondMeshPtr
49      && part_number == secondMeshPartNum
50     )
51     {
52        Info << "************* EEEEEEEEERRRRRRRRRRRRRRRRRR *************** "
53            << endl << flush;
54     }
55     else if
56     (
57         secondMeshPtr
58      && part_number <= secondMeshPartNum + nSecondMeshPatches
59     )
60     {
61         label patchi = part_number - secondMeshPartNum - 1;
63         const polyBoundaryMesh& bMesh = secondMeshPtr->boundaryMesh();
65         label np = 0;
66         forAll(bMesh[patchi], facei)
67         {
68             label nPoints = bMesh[patchi][facei].size();
69             if ((nPoints != 3) && (nPoints != 4))
70             {
71                 for(label i=0; i<nPoints; i++)
72                 {
73                     nsided_conn_array[np++] = bMesh[patchi][facei][i] + 1;
74                 }
75             }
76         }
77     }
78     else if
79     (
80         faMeshPtr
81      && part_number == Numparts_available
82     )
83     {
84         const faceList& faces = faMeshPtr->faces();
86         label np = 0;
88         forAll(faces, facei)
89         {
90             label nPoints = faces[facei].size();
92             if ((nPoints != 3) && (nPoints != 4))
93             {
94                 for(label i=0; i<nPoints; i++)
95                 {
96                     nsided_conn_array[np++] = faces[facei][i] + 1;
97                 }
98             }
99         }
100     }
102 #ifdef ENSIGHTDEBUG
103     Info << "Exiting: USERD_get_nsided_conn" << endl
104         << flush;
105 #endif
107     return Z_OK;