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/getPatchFieldScalar.H

81 lines
1.4 KiB
C++
Raw Normal View History

label patchi = which_part - 2;
if
(
nVar >= Num_variables - nSprayVariables
- nSecondMeshVariables - nFaMeshVariables
)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.headerOk())
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volScalarField sf
(
fieldObject,
mesh
);
const scalarField& sfb = sf.boundaryField()[patchi];
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
if (which_type == Z_TRI03)
{
label counter = 1;
for (label facei=0; facei<sfb.size(); facei++)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints == 3)
{
var_array[counter++] = sfb[facei];
}
}
}
if (which_type == Z_QUA04)
{
label counter = 1;
for (label facei=0; facei<sfb.size(); facei++)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints == 4)
{
var_array[counter++] = sfb[facei];
}
}
}
if (which_type == Z_NSIDED)
{
label counter = 1;
for (label facei=0; facei<sfb.size(); facei++)
{
label nPoints = bMesh[patchi][facei].size();
if ((nPoints != 3) && (nPoints != 4))
{
var_array[counter++] = sfb[facei];
}
}
}