This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/utilities/postProcessing/graphics/newEnsightFoamReader/getFaMeshFieldTensor.H
2010-08-25 22:42:57 +01:00

78 lines
1.3 KiB
C++

label offset = Num_variables - nFaMeshVariables;
if (nVar < offset || nVar >= Num_variables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
faMeshFieldNames[faMeshVar2field[nVar-offset]],
runTime.timeName(),
*meshPtr,
IOobject::NO_READ
);
if (!fieldObjectPtr.headerOk())
{
return Z_UNDEF;
}
IOobject fieldObject
(
faMeshFieldNames[faMeshVar2field[nVar-offset]],
runTime.timeName(),
*meshPtr,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
areaTensorField tf
(
fieldObject,
*faMeshPtr
);
const faceList& faces = faMeshPtr->faces();
label nFaces = faces.size();
if (which_type == Z_TRI03)
{
label counter = 1;
for (label n=0; n<nFaces; n++)
{
label nPoints = faces[n].size();
if (nPoints == 3)
{
# include "tensorConversion.H"
}
}
}
if (which_type == Z_QUA04)
{
label counter = 1;
for (label n=0; n<nFaces; n++)
{
label nPoints = faces[n].size();
if (nPoints == 4)
{
# include "tensorConversion.H"
}
}
}
if (which_type == Z_NSIDED)
{
label counter = 1;
for (label n=0; n<nFaces; n++)
{
label nPoints = faces[n].size();
if ((nPoints != 3) && (nPoints != 4))
{
# include "tensorConversion.H"
}
}
}