mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#5158 Grid Case Group: Allow statistics on static data only
Support grid cases with no dynamic data present.
This commit is contained in:
parent
ce94b6ff9e
commit
e0e984f703
@ -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() ) )
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user