BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / getPatchFieldVector.H
blobe002da1d05e852a4d498a4086538cb8281211d0a
1 label patchi = which_part - 2;
3 if
5     nVar >= Num_variables - nSprayVariables
6   - nSecondMeshVariables - nFaMeshVariables
9     return Z_UNDEF;
12 IOobject fieldObjectPtr
14     fieldNames[var2field[nVar]],
15     runTime.timeName(),
16     mesh,
17     IOobject::NO_READ
20 if (!fieldObjectPtr.headerOk())
22     return Z_UNDEF;
25 IOobject fieldObject
27     fieldNames[var2field[nVar]],
28     runTime.timeName(),
29     mesh,
30     IOobject::MUST_READ,
31     IOobject::NO_WRITE
34 volVectorField sf
36     fieldObject,
37     mesh
40 const vectorField& sfb = sf.boundaryField()[patchi];
41 const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
43 if (which_type == Z_TRI03)
45     label counter = 1;
46     for (label facei=0; facei<sfb.size(); facei++)
47     {
48         label nPoints = bMesh[patchi][facei].size();
49         if (nPoints == 3)
50         {
51             var_array[counter++] = sfb[facei][component];
52         }
53     }
56 if (which_type == Z_QUA04)
58     label counter = 1;
59     for (label facei=0; facei<sfb.size(); facei++)
60     {
61         label nPoints = bMesh[patchi][facei].size();
62         if (nPoints == 4)
63         {
64             var_array[counter++] = sfb[facei][component];
65         }
66     }
69 if (which_type == Z_NSIDED)
71     label counter = 1;
72     for (label facei=0; facei<sfb.size(); facei++)
73     {
74         label nPoints = bMesh[patchi][facei].size();
75         if ((nPoints != 3) && (nPoints != 4))
76         {
77             var_array[counter++] = sfb[facei][component];
78         }
79     }