mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Contour Statistics Map: Compute results
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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 ) )
|
||||
|
||||
Reference in New Issue
Block a user