(#166) Added support for ternary result mapping

Removed obsolete interface RigResultAccessor2d
This commit is contained in:
Magne Sjaastad
2015-11-23 15:24:03 +01:00
parent 95f500fefd
commit 6cd4e8a0b7
7 changed files with 144 additions and 62 deletions

View File

@@ -96,3 +96,52 @@ cvf::Vec2d RigTernaryResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, c
{
return cellScalar(gridLocalCellIndex);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec2d RigTernaryResultAccessor::cellScalarGlobIdx(size_t globCellIndex) const
{
double soil = 0.0;
double sgas = 0.0;
if (m_soilAccessor.notNull())
{
soil = m_soilAccessor->cellScalarGlobIdx(globCellIndex);
if (m_sgasAccessor.notNull())
{
sgas = m_sgasAccessor->cellScalarGlobIdx(globCellIndex);
}
else if (m_swatAccessor.notNull())
{
sgas = 1.0 - soil - m_swatAccessor->cellScalarGlobIdx(globCellIndex);
}
else
{
sgas = 1.0 - soil;
}
}
else
{
if (m_sgasAccessor.notNull())
{
sgas = m_sgasAccessor->cellScalarGlobIdx(globCellIndex);
if (m_swatAccessor.notNull())
{
soil = 1.0 - sgas - m_swatAccessor->cellScalarGlobIdx(globCellIndex);
}
else
{
soil = 1.0 - sgas;
}
}
else if (m_swatAccessor.notNull())
{
soil = 1.0 - m_swatAccessor->cellScalarGlobIdx(globCellIndex);
}
}
return cvf::Vec2d(soil, sgas);
}