Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / USERD_get_part_node_ids.H
blob19dfc758fd8332c69d35ac08d8736dc20539f7b4
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         for (label indx=0; indx<Num_global_nodes; indx++)
16         {
17             nodeid_array[indx] = indx + 1;
18         }
19     }
20     else if  (part_number < nPatches+2)
21     {
23         label patchi = part_number-2;
24         const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
25         const vectorField& points = bMesh[patchi].points();
27         label nPoints = points.size();
29         for (label indx=0; indx<nPoints; indx++)
30         {
31             nodeid_array[indx] = indx + 1;
32         }
34     }
35     else if  (part_number == nPatches+2)
36     {
37         label indx = 0;
38         for
39         (
40             Cloud<passiveParticle>::iterator elmnt = sprayPtr->begin();
41             elmnt != sprayPtr->end();
42             ++elmnt
43         )
44         {
45              nodeid_array[indx] = indx + 1;
46              indx++;
47         }
48     }
49     else
50     {
51         return Z_ERR;
52     }
54 #ifdef ENSIGHTDEBUG
55     Info << "Leaving: USERD_get_part_node_ids" << endl
56         << flush;
57 #endif
59     return Z_OK;