mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor : Hide loading of date for one time step from public API
ResInsight assumes that loading of data is done for all time steps at a time. Special handling of data loading is required for statistics calculations. Make statistical class a friend to be able to do this operation.
This commit is contained in:
parent
9373326281
commit
d9f4d4682f
@ -203,15 +203,13 @@ std::vector<double> RimEclipseContourMapProjection::generateResults( int timeSte
|
|||||||
RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "DZ" ) );
|
RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "DZ" ) );
|
||||||
if ( m_resultAggregation == RESULTS_OIL_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN )
|
if ( m_resultAggregation == RESULTS_OIL_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN )
|
||||||
{
|
{
|
||||||
resultData->ensureKnownResultLoadedForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
|
resultData->ensureKnownResultLoaded(
|
||||||
"SOIL" ),
|
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) );
|
||||||
timeStep );
|
|
||||||
}
|
}
|
||||||
if ( m_resultAggregation == RESULTS_GAS_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN )
|
if ( m_resultAggregation == RESULTS_GAS_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN )
|
||||||
{
|
{
|
||||||
resultData->ensureKnownResultLoadedForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
|
resultData->ensureKnownResultLoaded(
|
||||||
"SGAS" ),
|
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) );
|
||||||
timeStep );
|
|
||||||
}
|
}
|
||||||
gridResultValues = calculateColumnResult( m_resultAggregation() );
|
gridResultValues = calculateColumnResult( m_resultAggregation() );
|
||||||
}
|
}
|
||||||
|
@ -190,9 +190,11 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults( const QList<ResSpec>
|
|||||||
RimEclipseCase* sourceCase = m_sourceCases.at( caseIdx );
|
RimEclipseCase* sourceCase = m_sourceCases.at( caseIdx );
|
||||||
|
|
||||||
// Trigger loading of dataset
|
// Trigger loading of dataset
|
||||||
|
// NB! Many other functions are based on loading of all time steps at the same time
|
||||||
|
// Use this concept carefully
|
||||||
sourceCase->results( poroModel )
|
sourceCase->results( poroModel )
|
||||||
->ensureKnownResultLoadedForTimeStep( RigEclipseResultAddress( resultType, resultName ),
|
->findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( resultType, resultName ),
|
||||||
dataAccessTimeStepIndex );
|
dataAccessTimeStepIndex );
|
||||||
|
|
||||||
cvf::ref<RigResultAccessor> resultAccessor =
|
cvf::ref<RigResultAccessor> resultAccessor =
|
||||||
RigResultAccessorFactory::createFromResultAddress( sourceCase->eclipseCaseData(),
|
RigResultAccessorFactory::createFromResultAddress( sourceCase->eclipseCaseData(),
|
||||||
|
@ -1184,17 +1184,6 @@ void RigCaseCellResultsData::createResultEntry( const RigEclipseResultAddress& r
|
|||||||
findOrCreateScalarResultIndex( resultAddress, needsToBeStored );
|
findOrCreateScalarResultIndex( resultAddress, needsToBeStored );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RigCaseCellResultsData::ensureKnownResultLoadedForTimeStep( const RigEclipseResultAddress& resultAddress,
|
|
||||||
size_t timeStepIndex )
|
|
||||||
{
|
|
||||||
CAF_ASSERT( resultAddress.resultCatType() != RiaDefines::ResultCatType::UNDEFINED );
|
|
||||||
|
|
||||||
findOrLoadKnownScalarResultForTimeStep( resultAddress, timeStepIndex );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -127,7 +127,6 @@ public:
|
|||||||
bool updateResultName( RiaDefines::ResultCatType resultType, const QString& oldName, const QString& newName );
|
bool updateResultName( RiaDefines::ResultCatType resultType, const QString& oldName, const QString& newName );
|
||||||
QString makeResultNameUnique( const QString& resultNameProposal ) const;
|
QString makeResultNameUnique( const QString& resultNameProposal ) const;
|
||||||
|
|
||||||
void ensureKnownResultLoadedForTimeStep( const RigEclipseResultAddress& resultAddress, size_t timeStepIndex );
|
|
||||||
bool ensureKnownResultLoaded( const RigEclipseResultAddress& resultAddress );
|
bool ensureKnownResultLoaded( const RigEclipseResultAddress& resultAddress );
|
||||||
|
|
||||||
bool findAndLoadResultByName( const QString& resultName,
|
bool findAndLoadResultByName( const QString& resultName,
|
||||||
@ -150,7 +149,11 @@ private:
|
|||||||
size_t findOrLoadKnownScalarResultByResultTypeOrder( const RigEclipseResultAddress& resVarAddr,
|
size_t findOrLoadKnownScalarResultByResultTypeOrder( const RigEclipseResultAddress& resVarAddr,
|
||||||
const std::vector<RiaDefines::ResultCatType>& resultCategorySearchOrder );
|
const std::vector<RiaDefines::ResultCatType>& resultCategorySearchOrder );
|
||||||
|
|
||||||
|
// Add a friend class, as this way of loading data requires careful management of state
|
||||||
|
// All other data access assumes all time steps are loaded at the same time
|
||||||
|
friend class RimEclipseStatisticsCaseEvaluator;
|
||||||
size_t findOrLoadKnownScalarResultForTimeStep( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex );
|
size_t findOrLoadKnownScalarResultForTimeStep( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex );
|
||||||
|
|
||||||
size_t findOrCreateScalarResultIndex( const RigEclipseResultAddress& resVarAddr, bool needsToBeStored );
|
size_t findOrCreateScalarResultIndex( const RigEclipseResultAddress& resVarAddr, bool needsToBeStored );
|
||||||
|
|
||||||
size_t findScalarResultIndexFromAddress( const RigEclipseResultAddress& resVarAddr ) const;
|
size_t findScalarResultIndexFromAddress( const RigEclipseResultAddress& resVarAddr ) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user