//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RigGridAllCellsScalarDataAccess::setCellScalar(size_t gridLocalCellIndex, double scalarValue)
{
    size_t globalGridCellIndex = m_grid->globalGridCellIndex(gridLocalCellIndex);
    CVF_TIGHT_ASSERT(globalGridCellIndex < m_reservoirResultValues->size());

    (*m_reservoirResultValues)[globalGridCellIndex] = scalarValue;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
double RigGridAllCellsScalarDataAccess::cellScalar(size_t gridLocalCellIndex) const
{
    if (m_reservoirResultValues->size() == 0 ) return HUGE_VAL;

    size_t globalGridCellIndex = m_grid->globalGridCellIndex(gridLocalCellIndex);
    CVF_TIGHT_ASSERT(globalGridCellIndex < m_reservoirResultValues->size());

    return m_reservoirResultValues->at(globalGridCellIndex);
}