db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
143 lines
2.9 KiB
C
143 lines
2.9 KiB
C
label offset = Num_variables - nSecondMeshVariables - nFaMeshVariables;
|
|
|
|
if (nVar < offset || nVar >= (Num_variables-nFaMeshVariables))
|
|
{
|
|
return Z_UNDEF;
|
|
}
|
|
|
|
IOobject fieldObjectPtr
|
|
(
|
|
secondMeshFieldNames[secondMeshVar2field[nVar-offset]],
|
|
runTime.timeName(),
|
|
*secondMeshPtr,
|
|
IOobject::NO_READ
|
|
);
|
|
|
|
if (!fieldObjectPtr.headerOk())
|
|
{
|
|
return Z_UNDEF;
|
|
}
|
|
|
|
IOobject fieldObject
|
|
(
|
|
secondMeshFieldNames[secondMeshVar2field[nVar-offset]],
|
|
runTime.timeName(),
|
|
*secondMeshPtr,
|
|
IOobject::MUST_READ,
|
|
IOobject::NO_WRITE
|
|
);
|
|
|
|
volTensorField tf
|
|
(
|
|
fieldObject,
|
|
*secondMeshPtr
|
|
);
|
|
|
|
const cellShapeList& cellShapes = secondMeshPtr->cellShapes();
|
|
|
|
// hexa's
|
|
if (which_type == Z_HEX08)
|
|
{
|
|
const cellModel& hex = *(cellModeller::lookup("hex"));
|
|
//const cellModel& wedge = *(cellModeller::lookup("wedge"));
|
|
|
|
label counter = 1;
|
|
for (label n=0; n<nCells; n++)
|
|
{
|
|
const cellShape& cellShape = cellShapes[n];
|
|
const cellModel& cellModel = cellShape.model();
|
|
|
|
if (cellModel == hex) // || (cellModel == wedge))
|
|
{
|
|
# include "tensorConversion.H"
|
|
}
|
|
}
|
|
}
|
|
|
|
// penta's
|
|
if (which_type == Z_PEN06)
|
|
{
|
|
const cellModel& prism = *(cellModeller::lookup("prism"));
|
|
|
|
label counter = 1;
|
|
for (label n=0; n<nCells; n++)
|
|
{
|
|
const cellShape& cellShape = cellShapes[n];
|
|
const cellModel& cellModel = cellShape.model();
|
|
|
|
if (cellModel == prism)
|
|
{
|
|
# include "tensorConversion.H"
|
|
}
|
|
}
|
|
}
|
|
|
|
// pyramids's
|
|
if (which_type == Z_PYR05)
|
|
{
|
|
const cellModel& pyr = *(cellModeller::lookup("pyr"));
|
|
|
|
label counter = 1;
|
|
for (label n=0; n<nCells; n++)
|
|
{
|
|
const cellShape& cellShape = cellShapes[n];
|
|
const cellModel& cellModel = cellShape.model();
|
|
|
|
if (cellModel == pyr)
|
|
{
|
|
# include "tensorConversion.H"
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// penta's
|
|
if (which_type == Z_TET04)
|
|
{
|
|
const cellModel& tet = *(cellModeller::lookup("tet"));
|
|
|
|
label counter = 1;
|
|
|
|
for (label n=0; n<nCells; n++)
|
|
{
|
|
const cellShape& cellShape = cellShapes[n];
|
|
const cellModel& cellModel = cellShape.model();
|
|
|
|
if (cellModel == tet)
|
|
{
|
|
# include "tensorConversion.H"
|
|
}
|
|
}
|
|
}
|
|
|
|
if (which_type == Z_NFACED)
|
|
{
|
|
const cellList& cells = secondMeshPtr->cells();
|
|
|
|
label counter = 1;
|
|
for (label n=0; n<nCells; n++)
|
|
{
|
|
const labelList& points = cellShapes[n];
|
|
label nFacesInCell = cells[n].size();
|
|
|
|
if ((nFacesInCell == 6) && (points.size() == 8))
|
|
{}
|
|
else if ((nFacesInCell == 4) && (points.size() == 4))
|
|
{}
|
|
else if (nFacesInCell == 5)
|
|
{
|
|
if (points.size() == 6)
|
|
{}
|
|
else if (points.size() == 5)
|
|
{}
|
|
else
|
|
{
|
|
# include "tensorConversion.H"
|
|
}
|
|
}
|
|
else
|
|
{
|
|
# include "tensorConversion.H"
|
|
}
|
|
}
|
|
}
|