BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / USERD_get_part_node_ids.H
blobc918f19f084be81c80871347f4d4267f9257f519
1 int USERD_get_part_node_ids
3     int part_number,
4     int *nodeid_array
7 #ifdef ENSIGHTDEBUG
8     Info << "Entering: USERD_get_part_node_ids" << endl
9         << "part_number = " << part_number << endl
10         << flush;
11 #endif
13     if (part_number == 1)
14     {
15         label nPoints = meshPtr->points().size();
17         for (label indx=0; indx<nPoints; indx++)
18         {
19             nodeid_array[indx] = indx + 1;
20         }
21     }
22     else if  (part_number < nPatches+2)
23     {
25         label patchi = part_number-2;
26         const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
27         const vectorField& points = bMesh[patchi].points();
29         label nPoints = points.size();
31         for (label indx=0; indx<nPoints; indx++)
32         {
33             nodeid_array[indx] = indx + 1;
34         }
36     }
37     else if  (sprayPtr && part_number == nPatches+2)
38     {
39         label indx = 0;
40         for
41         (
42             Cloud<passiveParticle>::iterator elmnt = sprayPtr->begin();
43             elmnt != sprayPtr->end();
44             ++elmnt
45         )
46         {
47              nodeid_array[indx] = indx + 1;
48              indx++;
49         }
50     }
51     else if
52     (
53         secondMeshPtr
54      && part_number == secondMeshPartNum
55     )
56     {
57         label nPoints = secondMeshPtr->points().size();
59         for (label indx=0; indx<nPoints; indx++)
60         {
61             nodeid_array[indx] = indx + 1;
62         }
63     }
64     else if
65     (
66         secondMeshPtr
67      && part_number <= secondMeshPartNum + nSecondMeshPatches
68     )
69     {
70         label patchi = part_number - secondMeshPartNum - 1;
72         const polyBoundaryMesh& bMesh = secondMeshPtr->boundaryMesh();
73         const vectorField& points = bMesh[patchi].points();
74         label nPoints = points.size();
76         for (label indx=0; indx<nPoints; indx++)
77         {
78             nodeid_array[indx] = indx + 1;
79         }
80     }
81     else if
82     (
83         faMeshPtr
84      && part_number == Numparts_available
85     )
86     {
87         label nPoints = faMeshPtr->points().size();
89         for (label indx=0; indx<nPoints; indx++)
90         {
91             nodeid_array[indx] = indx + 1;
92         }
93     }
94     else
95     {
96         return Z_ERR;
97     }
99 #ifdef ENSIGHTDEBUG
100     Info << "Leaving: USERD_get_part_node_ids" << endl
101         << flush;
102 #endif
104     return Z_OK;