mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4731 Fix more crashes for ensemble RFT data import
This commit is contained in:
@@ -221,7 +221,9 @@ void RifReaderEnsembleStatisticsRft::calculateStatistics( const RifEclipseRftAdd
|
||||
if ( !allDepths.empty() )
|
||||
{
|
||||
// Make sure we end up with approximately the same amount of points as originally
|
||||
size_t sizeMultiplier = allDepths.size() / dataSetSizeCalc.weightedMean();
|
||||
// Since allDepths contain *valid* values, it can potentially be smaller than the mean.
|
||||
// Thus we need to ensure sizeMultiplier is at least 1.
|
||||
size_t sizeMultiplier = std::max( (size_t)1, allDepths.size() / dataSetSizeCalc.weightedMean() );
|
||||
for ( size_t depthIdx = 0; depthIdx < allDepths.size(); depthIdx += sizeMultiplier )
|
||||
{
|
||||
std::vector<double> pressuresAtDepth;
|
||||
|
||||
Reference in New Issue
Block a user