ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / getPatchFieldScalar.H
blob46f4f46d8d3d719724c1f0ca1f0a191aecc19ae8
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     forAll(sfb, 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     forAll(sfb, 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     forAll(sfb, facei)
69     {
70         label nPoints = bMesh[patchi][facei].size();
71         if (nPoints != 3 && nPoints != 4)
72         {
73             var_array[counter++] = sfb[facei];
74         }
75     }