BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / getFieldTensor.H
blob9e605fe869799d5f6578e702a7a116a7835673a3
1 if
3     nVar >=
4     Num_variables - nSprayVariables
5   - nSecondMeshVariables - nFaMeshVariables
8     return Z_UNDEF;
11 IOobject fieldObjectPtr
13     fieldNames[var2field[nVar]],
14     runTime.timeName(),
15     mesh,
16     IOobject::NO_READ
19 if (!fieldObjectPtr.headerOk())
21     return Z_UNDEF;
24 IOobject fieldObject
26     fieldNames[var2field[nVar]],
27     runTime.timeName(),
28     mesh,
29     IOobject::MUST_READ,
30     IOobject::NO_WRITE
33 volTensorField tf
35     fieldObject,
36     mesh
39 const cellShapeList& cellShapes = meshPtr->cellShapes();
41 // hexa's
42 if (which_type == Z_HEX08)
44     const cellModel& hex = *(cellModeller::lookup("hex"));
45     //const cellModel& wedge = *(cellModeller::lookup("wedge"));
47     label counter = 1;
48     for (label n=0; n<nCells; n++)
49     {
50         const cellShape& cellShape = cellShapes[n];
51         const cellModel& cellModel = cellShape.model();
53         if (cellModel == hex) // || (cellModel == wedge))
54         {
55 #           include "tensorConversion.H"
56         }
57     }
60 // penta's
61 if (which_type == Z_PEN06)
63     const cellModel& prism = *(cellModeller::lookup("prism"));
65     label counter = 1;
66     for (label n=0; n<nCells; n++)
67     {
68         const cellShape& cellShape = cellShapes[n];
69         const cellModel& cellModel = cellShape.model();
71         if (cellModel == prism)
72         {
73 #           include "tensorConversion.H"
74         }
75     }
78 // pyramids's
79 if (which_type == Z_PYR05)
81     const cellModel& pyr = *(cellModeller::lookup("pyr"));
83     label counter = 1;
84     for (label n=0; n<nCells; n++)
85     {
86         const cellShape& cellShape = cellShapes[n];
87         const cellModel& cellModel = cellShape.model();
89         if (cellModel == pyr)
90         {
91 #           include "tensorConversion.H"
92         }
93     }
97 // penta's
98 if (which_type == Z_TET04)
100     const cellModel& tet = *(cellModeller::lookup("tet"));
102     label counter = 1;
104     for (label n=0; n<nCells; n++)
105     {
106         const cellShape& cellShape = cellShapes[n];
107         const cellModel& cellModel = cellShape.model();
109         if (cellModel == tet)
110         {
111 #           include "tensorConversion.H"
112         }
113     }
116 if (which_type == Z_NFACED)
118     const cellList& cells = meshPtr->cells();
120     label counter = 1;
121     for (label n=0; n<nCells; n++)
122     {
123         const labelList& points = cellShapes[n];
124         label nFacesInCell = cells[n].size();
126         if ((nFacesInCell == 6) && (points.size() == 8))
127         {}
128         else if ((nFacesInCell == 4) && (points.size() == 4))
129         {}
130         else if (nFacesInCell == 5)
131         {
132             if (points.size() == 6)
133             {}
134             else if (points.size() == 5)
135             {}
136             else
137             {
138 #               include "tensorConversion.H"
139             }
140         }
141         else
142         {
143 #           include "tensorConversion.H"
144         }
145     }