initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / getPatchFieldScalar.H
blob0c91c665e60beeef1f8fc679f7c739950be108a3
1 label patchi = which_part - 2;
3 if (nVar >= Num_variables - nSprayVariables)
5     return Z_UNDEF;
8 IOobject fieldObjectPtr
10     fieldNames[var2field[nVar]],
11     runTime.timeName(),
12     mesh,
13     IOobject::NO_READ
16 if (!fieldObjectPtr.headerOk())
18     return Z_UNDEF;
21 IOobject fieldObject
23     fieldNames[var2field[nVar]],
24     runTime.timeName(),
25     mesh,
26     IOobject::MUST_READ,
27     IOobject::NO_WRITE
30 volScalarField sf
32     fieldObject,
33     mesh
36 const scalarField& sfb = sf.boundaryField()[patchi];
37 const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
39 if (which_type == Z_TRI03)
41     label counter = 1;
42     for (label facei=0; facei<sfb.size(); facei++)
43     {
44         label nPoints = bMesh[patchi][facei].size();
45         if (nPoints == 3)
46         {
47             var_array[counter++] = sfb[facei];
48         }
49     }
52 if (which_type == Z_QUA04)
54     label counter = 1;
55     for (label facei=0; facei<sfb.size(); facei++)
56     {
57         label nPoints = bMesh[patchi][facei].size();
58         if (nPoints == 4)
59         {
60             var_array[counter++] = sfb[facei];
61         }
62     }
65 if (which_type == Z_NSIDED)
67     label counter = 1;
68     for (label facei=0; facei<sfb.size(); facei++)
69     {
70         label nPoints = bMesh[patchi][facei].size();
71         if ((nPoints != 3) && (nPoints != 4))
72         {
73             var_array[counter++] = sfb[facei];
74         }
75     }