Contour Statistics Map: Compute results

This commit is contained in:
Kristian Bendiksen
2024-11-06 14:25:25 +01:00
parent c4dd4865f4
commit e2940e4eaf
5 changed files with 102 additions and 23 deletions

View File

@@ -300,7 +300,7 @@ std::vector<RigContourMapCalculator::CellIndexAndResult>
auto cellGridIdxVisibility = contourMapProjection.getCellVisibility();
for ( size_t globalCellIdx : allCellIndices )
{
if ( ( *cellGridIdxVisibility )[globalCellIdx] )
if ( cellGridIdxVisibility.isNull() || ( *cellGridIdxVisibility )[globalCellIdx] )
{
kLayerCellIndexVector[contourMapProjection.kLayer( globalCellIdx )].push_back( globalCellIdx );
}

View File

@@ -18,6 +18,7 @@
#include "RigContourMapProjection.h"
#include "RiaStatisticsTools.h"
#include "RiaWeightedMeanCalculator.h"
#include "RigContourMapCalculator.h"
@@ -28,6 +29,7 @@
#include <algorithm>
#include <array>
#include <limits>
//--------------------------------------------------------------------------------------------------
///
@@ -210,16 +212,8 @@ double RigContourMapProjection::calculateValueInMapCell( unsigned int
//--------------------------------------------------------------------------------------------------
double RigContourMapProjection::maxValue( const std::vector<double>& aggregatedResults )
{
double maxV = -std::numeric_limits<double>::infinity();
for ( size_t index = 0; index < aggregatedResults.size(); ++index )
{
if ( aggregatedResults[index] != std::numeric_limits<double>::infinity() )
{
maxV = std::max( maxV, aggregatedResults[index] );
}
}
return maxV;
double maxV = RiaStatisticsTools::maximumValue( aggregatedResults );
return maxV != -std::numeric_limits<double>::max() ? maxV : -std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
@@ -227,16 +221,8 @@ double RigContourMapProjection::maxValue( const std::vector<double>& aggregatedR
//--------------------------------------------------------------------------------------------------
double RigContourMapProjection::minValue( const std::vector<double>& aggregatedResults )
{
double minV = std::numeric_limits<double>::infinity();
for ( size_t index = 0; index < aggregatedResults.size(); ++index )
{
if ( aggregatedResults[index] != std::numeric_limits<double>::infinity() )
{
minV = std::min( minV, aggregatedResults[index] );
}
}
return minV;
double minV = RiaStatisticsTools::minimumValue( aggregatedResults );
return minV != std::numeric_limits<double>::max() ? minV : std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -129,6 +129,7 @@ std::pair<bool, std::vector<double>>
// TODO: this was RimEclipseCellColors->hasStaticResult()
if ( resultAddress.resultCatType() == RiaDefines::ResultCatType::STATIC_NATIVE && timeStep > 0 ) timeStep = 0;
resultData.ensureKnownResultLoaded( resultAddress );
// When loading a project file, grid calculator results are not computed the first time this function is
// called. Must check if result is loaded. See RimReloadCaseTools::updateAll3dViews()
if ( resultAddress.isValid() && resultData.hasResultEntry( resultAddress ) && resultData.isResultLoaded( resultAddress ) )