Stop ResInsight from crashing when calculating cell volume (#8374)

* Stop ResInsight from crashing when calculating cell volume
This commit is contained in:
jonjenssen
2021-12-17 16:10:24 +01:00
committed by Magne Sjaastad
parent 985a2c8f30
commit 3bb6642900
6 changed files with 13 additions and 72 deletions

View File

@@ -25,7 +25,6 @@
//--------------------------------------------------------------------------------------------------
RigActiveCellInfo::RigActiveCellInfo()
: m_reservoirActiveCellCount( 0 )
, m_reservoirCellResultCount( 0 )
, m_activeCellPositionMin( cvf::Vec3d::ZERO )
, m_activeCellPositionMax( cvf::Vec3d::ZERO )
{
@@ -47,14 +46,6 @@ size_t RigActiveCellInfo::reservoirCellCount() const
return m_cellIndexToResultIndex.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigActiveCellInfo::reservoirCellResultCount() const
{
return m_reservoirCellResultCount;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -75,11 +66,6 @@ bool RigActiveCellInfo::isActive( size_t reservoirCellIndex ) const
//--------------------------------------------------------------------------------------------------
size_t RigActiveCellInfo::cellResultIndex( size_t reservoirCellIndex ) const
{
if ( m_cellIndexToResultIndex.size() == 0 )
{
return reservoirCellIndex;
}
CVF_TIGHT_ASSERT( reservoirCellIndex < m_cellIndexToResultIndex.size() );
return m_cellIndexToResultIndex[reservoirCellIndex];
@@ -94,11 +80,11 @@ void RigActiveCellInfo::setCellResultIndex( size_t reservoirCellIndex, size_t re
m_cellIndexToResultIndex[reservoirCellIndex] = reservoirCellResultIndex;
if ( reservoirCellResultIndex >= m_reservoirCellResultCount )
{
#pragma omp critical
m_reservoirCellResultCount = reservoirCellResultIndex + 1;
}
// if ( reservoirCellResultIndex >= m_reservoirActiveCellCount )
// {
//#pragma omp critical
// m_reservoirActiveCellCount = reservoirCellResultIndex + 1;
// }
}
//--------------------------------------------------------------------------------------------------
@@ -215,14 +201,6 @@ void RigActiveCellInfo::addLgr( size_t cellCount )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigActiveCellInfo::isCoarseningActive() const
{
return m_reservoirCellResultCount != m_reservoirActiveCellCount;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------