Refactor: Improve interface for characteristicCellSize()

This commit is contained in:
Kristian Bendiksen
2025-10-06 09:10:58 +02:00
committed by Magne Sjaastad
parent ec3e1b59cd
commit 5c48383d71
8 changed files with 32 additions and 54 deletions
@@ -408,11 +408,10 @@ double RigGridBase::characteristicIJCellSize() const
{
double characteristicCellSize = HUGE_VAL;
double cellSizeI, cellSizeJ, cellSizeK;
characteristicCellSizes( &cellSizeI, &cellSizeJ, &cellSizeK );
cvf::Vec3d cellSize = characteristicCellSizes();
if ( cellSizeI < characteristicCellSize ) characteristicCellSize = cellSizeI;
if ( cellSizeJ < characteristicCellSize ) characteristicCellSize = cellSizeJ;
if ( cellSize.x() < characteristicCellSize ) return cellSize.x();
if ( cellSize.y() < characteristicCellSize ) return cellSize.y();
return characteristicCellSize;
}
@@ -420,10 +419,8 @@ double RigGridBase::characteristicIJCellSize() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGridBase::characteristicCellSizes( double* iSize, double* jSize, double* kSize ) const
cvf::Vec3d RigGridBase::characteristicCellSizes() const
{
CVF_ASSERT( iSize && jSize && kSize );
if ( !hasValidCharacteristicCellSizes() )
{
std::vector<size_t> reservoirCellIndices;
@@ -433,9 +430,7 @@ void RigGridBase::characteristicCellSizes( double* iSize, double* jSize, double*
computeCharacteristicCellSize( reservoirCellIndices );
}
*iSize = m_characteristicCellSizeI;
*jSize = m_characteristicCellSizeJ;
*kSize = m_characteristicCellSizeK;
return m_characteristicCellSize;
}
//--------------------------------------------------------------------------------------------------