mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#166) Added support for ternary result mapping
Removed obsolete interface RigResultAccessor2d
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user