#5158 Grid Case Group: Allow statistics on static data only

Support grid cases with no dynamic data present.
This commit is contained in:
Magne Sjaastad 2019-12-03 12:58:04 +01:00
parent ce94b6ff9e
commit e0e984f703
3 changed files with 13 additions and 7 deletions

View File

@ -291,11 +291,6 @@ bool RimEclipseResultCase::openAndReadActiveCellData( RigEclipseCaseData* mainEc
eclipseCase->setMainGrid( mainEclipseCase->mainGrid() );
std::vector<QDateTime> timeStepDates = mainEclipseCase->results( RiaDefines::MATRIX_MODEL )->timeStepDates();
if ( timeStepDates.size() == 0 )
{
return false;
}
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
if ( !readerEclipseOutput->openAndReadActiveCellData( caseFileName(), timeStepDates, eclipseCase.p() ) )
{

View File

@ -252,6 +252,12 @@ void RimEclipseStatisticsCase::computeStatistics()
timeStepIndices.push_back( i );
}
// If no dynamic data is present, we might end up with no time steps. Make sure we have at least one.
if ( timeStepIndices.empty() )
{
timeStepIndices.push_back( 0 );
}
RigEclipseCaseData* resultCase = eclipseCaseData();
QList<RimEclipseStatisticsCaseEvaluator::ResSpec> resultSpecification;

View File

@ -36,6 +36,8 @@
#include <QDebug>
#include <algorithm>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -57,10 +59,13 @@ void RimEclipseStatisticsCaseEvaluator::addNamedResult( RigCaseCellResultsData*
destinationCellResults->setTimeStepInfos( resAddr, sourceTimeStepInfos );
std::vector<std::vector<double>>* dataValues = destinationCellResults->modifiableCellScalarResultTimesteps( resAddr );
dataValues->resize( sourceTimeStepInfos.size() );
size_t timeStepCount = std::max( size_t( 1 ), sourceTimeStepInfos.size() );
dataValues->resize( timeStepCount );
// Initializes the size of the destination dataset to active union cell count
for ( size_t i = 0; i < sourceTimeStepInfos.size(); i++ )
for ( size_t i = 0; i < timeStepCount; i++ )
{
dataValues->at( i ).resize( activeUnionCellCount, HUGE_VAL );
}