#724 Grid Case Group Statistics: Add option to include in-active cell value as zero

This commit is contained in:
Magne Sjaastad
2016-09-01 18:08:51 +02:00
parent 8098578545
commit f1451a1126
4 changed files with 36 additions and 3 deletions

View File

@@ -27,6 +27,7 @@
#include "RigResultModifierFactory.h"
#include "RigStatisticsMath.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimReservoirCellResultsStorage.h"
#include "cafProgressInfo.h"
@@ -203,12 +204,19 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
{
// Extract the cell values from each of the cases and assemble them into one vector
bool foundAnyValidValues = false;
for (size_t caseIdx = 0; caseIdx < sourceDataAccessList.size(); caseIdx++)
{
double val = sourceDataAccessList.at(caseIdx)->cellScalar(cellIdx);
// If identical grid case group is set, treat huge_val as zero in the statistical computation
if (m_identicalGridCaseGroup && m_identicalGridCaseGroup->unionOfActiveCells(poroModel)->isActive(reservoirCellIndex))
{
if (val == HUGE_VAL)
{
val = 0.0;
}
}
values[caseIdx] = val;
if (val != HUGE_VAL)
@@ -217,6 +225,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
}
}
// Do the real statistics calculations
@@ -311,7 +320,8 @@ RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::
m_statisticsConfig(statisticsConfig),
m_destinationCase(destinationCase),
m_reservoirCellCount(0),
m_timeStepIndices(timeStepIndices)
m_timeStepIndices(timeStepIndices),
m_identicalGridCaseGroup(NULL)
{
if (sourceCases.size() > 0)
{
@@ -321,3 +331,11 @@ RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::
CVF_ASSERT(m_destinationCase);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseStatisticsCaseEvaluator::useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells(RimIdenticalGridCaseGroup* identicalGridCaseGroup)
{
m_identicalGridCaseGroup = identicalGridCaseGroup;
}