Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / USERD_get_nsided_conn.H
blob9557b5ae532f445f9d8ea599ec423df24aa4e775
1 int USERD_get_nsided_conn
3     int part_number,
4     int *nsided_conn_array
7 #ifdef ENSIGHTDEBUG
8     Info<< "Entering: USERD_get_nsided_conn"
9         << ", part_number = " << part_number
10         << endl
11         << flush;
12 #endif
13     if (part_number == 1)
14     {
15         Info<< "************* EEEEEEEEERRRRRRRRRRRRRRRRRR *************** "
16             << endl << flush;
18     }
19     else if (part_number < nPatches+2)
20     {
21         //const cellList& cells = meshPtr->cells();
22         //const faceList& faces = meshPtr->faces();
24         label patchi = part_number - 2;
25         const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
27         label np = 0;
28         forAll(bMesh[patchi], facei)
29         {
30             label nPoints = bMesh[patchi][facei].size();
31             if ((nPoints != 3) && (nPoints != 4))
32             {
33                 for (label i=0; i<nPoints; i++)
34                 {
35                     nsided_conn_array[np++] = bMesh[patchi][facei][i] + 1;
36                 }
37             }
38         }
39     }
40     else if (part_number == nPatches+2)
41     {
42         return Z_ERR;
43     }
44 #ifdef ENSIGHTDEBUG
45     Info<< "Exiting: USERD_get_nsided_conn" << endl
46         << flush;
47 #endif
48     return Z_OK;