ResInsight/ApplicationLibCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp

89 lines
3.5 KiB
C++
Raw Normal View History

2014-08-06 07:04:26 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
2014-09-24 00:14:52 -05:00
// Copyright (C) Statoil ASA
// Copyright (C) Ceetron Solutions AS
//
2014-08-06 07:04:26 -05:00
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
2014-08-06 07:04:26 -05:00
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
2014-08-06 07:04:26 -05:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RigCellEdgeResultAccessor.h"
2014-08-06 07:04:26 -05:00
#include <cmath>
2014-08-06 07:04:26 -05:00
//--------------------------------------------------------------------------------------------------
///
2014-08-06 07:04:26 -05:00
//--------------------------------------------------------------------------------------------------
RigCellEdgeResultAccessor::RigCellEdgeResultAccessor()
{
}
2014-08-06 07:04:26 -05:00
//--------------------------------------------------------------------------------------------------
///
2014-08-06 07:04:26 -05:00
//--------------------------------------------------------------------------------------------------
void RigCellEdgeResultAccessor::setDataAccessObjectForFace( cvf::StructGridInterface::FaceType faceId,
RigResultAccessor* resultAccessObject )
2014-08-06 07:04:26 -05:00
{
m_resultAccessObjects[faceId] = resultAccessObject;
}
//--------------------------------------------------------------------------------------------------
///
2014-08-06 07:04:26 -05:00
//--------------------------------------------------------------------------------------------------
double RigCellEdgeResultAccessor::cellScalar( size_t gridLocalCellIndex ) const
2014-08-06 07:04:26 -05:00
{
// TODO: How to handle when we get here?
CVF_ASSERT( false );
2014-08-06 07:04:26 -05:00
return cvf::UNDEFINED_DOUBLE;
}
//--------------------------------------------------------------------------------------------------
///
2014-08-06 07:04:26 -05:00
//--------------------------------------------------------------------------------------------------
double RigCellEdgeResultAccessor::cellFaceScalar( size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId ) const
2014-08-06 07:04:26 -05:00
{
const RigResultAccessor* resultAccessObj = m_resultAccessObjects[faceId].p();
if ( resultAccessObj != nullptr )
2014-08-06 07:04:26 -05:00
{
return resultAccessObj->cellFaceScalar( gridLocalCellIndex, faceId );
2014-08-06 07:04:26 -05:00
}
return HUGE_VAL;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigCellEdgeResultAccessor::cellScalarGlobIdx( size_t globCellIndex ) const
{
// TODO: How to handle when we get here?
CVF_ASSERT( false );
return cvf::UNDEFINED_DOUBLE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigCellEdgeResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex, cvf::StructGridInterface::FaceType faceId ) const
{
const RigResultAccessor* resultAccessObj = m_resultAccessObjects[faceId].p();
if ( resultAccessObj != nullptr )
{
return resultAccessObj->cellFaceScalarGlobIdx( globCellIndex, faceId );
}
return HUGE_VAL;
}