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.
|
|
|
|
//
|
|
|
|
// 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>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-08-07 07:20:20 -05:00
|
|
|
#include "RigCellEdgeResultAccessor.h"
|
2014-08-06 07:04:26 -05:00
|
|
|
|
2014-08-06 08:14:01 -05:00
|
|
|
#include <cmath>
|
|
|
|
|
2014-08-06 07:04:26 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2014-08-07 07:56:29 -05:00
|
|
|
RigCellEdgeResultAccessor::RigCellEdgeResultAccessor()
|
2014-08-06 07:04:26 -05:00
|
|
|
{
|
2014-08-08 01:38:12 -05:00
|
|
|
|
2014-08-06 07:04:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2014-08-07 06:32:31 -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-08 02:50:57 -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);
|
|
|
|
|
|
|
|
return cvf::UNDEFINED_DOUBLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2014-08-08 02:50:57 -05:00
|
|
|
double RigCellEdgeResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const
|
2014-08-06 07:04:26 -05:00
|
|
|
{
|
2014-08-08 01:38:12 -05:00
|
|
|
const RigResultAccessor* resultAccessObj = m_resultAccessObjects[faceId].p();
|
2014-08-06 07:04:26 -05:00
|
|
|
if (resultAccessObj != NULL)
|
|
|
|
{
|
2014-08-08 02:50:57 -05:00
|
|
|
return resultAccessObj->cellFaceScalar(gridLocalCellIndex, faceId);
|
2014-08-06 07:04:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return HUGE_VAL;
|
|
|
|
}
|
|
|
|
|
2015-08-30 14:25:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
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 != NULL)
|
|
|
|
{
|
|
|
|
return resultAccessObj->cellFaceScalarGlobIdx(globCellIndex, faceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
return HUGE_VAL;
|
|
|
|
}
|
|
|
|
|