Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / getSecondMeshPatchFieldTensor.H
blobd9850ff9a85a05af2e6a38b31cd1f5fc18f84922
2 label secondMeshPartNum = nPatches+2;
4 if(sprayPtr)
6     secondMeshPartNum += 1;
9 label patchi = which_part - secondMeshPartNum - 1;
11 label offset = Num_variables - nSecondMeshVariables - nFaMeshVariables;
13 if (nVar < offset || nVar >= (Num_variables-nFaMeshVariables))
15     return Z_UNDEF;
18 IOobject fieldObjectPtr
20     secondMeshFieldNames[secondMeshVar2field[nVar-offset]],
21     runTime.timeName(),
22     *secondMeshPtr,
23     IOobject::NO_READ
26 if (!fieldObjectPtr.headerOk())
28     return Z_UNDEF;
31 IOobject fieldObject
33     secondMeshFieldNames[secondMeshVar2field[nVar-offset]],
34     runTime.timeName(),
35     *secondMeshPtr,
36     IOobject::MUST_READ,
37     IOobject::NO_WRITE
40 volTensorField sf
42     fieldObject,
43     *secondMeshPtr
46 const tensorField& tf = sf.boundaryField()[patchi];
47 const polyBoundaryMesh& bMesh = secondMeshPtr->boundaryMesh();
49 if (which_type == Z_TRI03)
51     label counter = 1;
52     for (label n=0; n<tf.size(); n++)
53     {
54         label nPoints = bMesh[patchi][n].size();
55         if (nPoints == 3)
56         {
57 #           include "tensorConversion.H"
58         }
59     }
62 if (which_type == Z_QUA04)
64     label counter = 1;
65     for (label n=0; n<tf.size(); n++)
66     {
67         label nPoints = bMesh[patchi][n].size();
68         if (nPoints == 4)
69         {
70 #           include "tensorConversion.H"
71         }
72     }
75 if (which_type == Z_NSIDED)
77     label counter = 1;
78     for (label n=0; n<tf.size(); n++)
79     {
80         label nPoints = bMesh[patchi][n].size();
81         if ((nPoints != 3) && (nPoints != 4))
82         {
83 #           include "tensorConversion.H"
84         }
85     }