mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add support for grid calculations as data source for statistics
- add data source selection, either Case Property or Grid Calculation - add Time Step Selection, can be used for both dynamic case properties and Grid Calculations - optionally release grid calculation data when statistics is computed - recursive grid calculations is supported
This commit is contained in:
@@ -699,23 +699,34 @@ void RigCaseCellResultsData::clearAllResults()
|
||||
/// Removes all the actual numbers put into this object, and frees up the memory.
|
||||
/// Does not touch the metadata in any way
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::freeAllocatedResultsData()
|
||||
void RigCaseCellResultsData::freeAllocatedResultsData( std::vector<RiaDefines::ResultCatType> categoriesToExclude,
|
||||
std::optional<size_t> timeStepIndexToRelease )
|
||||
{
|
||||
for ( size_t resultIdx = 0; resultIdx < m_cellScalarResults.size(); ++resultIdx )
|
||||
{
|
||||
if ( resultIdx < m_resultInfos.size() &&
|
||||
m_resultInfos[resultIdx].eclipseResultAddress().resultCatType() == RiaDefines::ResultCatType::GENERATED )
|
||||
if ( resultIdx < m_resultInfos.size() )
|
||||
{
|
||||
// Not possible to recreate generated results, keep them
|
||||
continue;
|
||||
auto resultCategory = m_resultInfos[resultIdx].eclipseResultAddress().resultCatType();
|
||||
if ( std::find( categoriesToExclude.begin(), categoriesToExclude.end(), resultCategory ) != categoriesToExclude.end() )
|
||||
{
|
||||
// Keep generated results for these categories
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto& tsIdx : m_cellScalarResults[resultIdx] )
|
||||
for ( size_t index = 0; index < m_cellScalarResults[resultIdx].size(); index++ )
|
||||
{
|
||||
if ( timeStepIndexToRelease && index != *timeStepIndexToRelease )
|
||||
{
|
||||
// Keep generated results for these time steps
|
||||
continue;
|
||||
}
|
||||
|
||||
auto& dataForTimeStep = m_cellScalarResults[resultIdx][index];
|
||||
// Using swap with an empty vector as that is the safest way to really get rid of the allocated data in a
|
||||
// vector
|
||||
std::vector<double> empty;
|
||||
tsIdx.swap( empty );
|
||||
dataForTimeStep.swap( empty );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
class RifReaderInterface;
|
||||
@@ -116,7 +117,7 @@ public:
|
||||
void clearScalarResult( RiaDefines::ResultCatType type, const QString& resultName );
|
||||
void clearScalarResult( const RigEclipseResultAddress& resultAddress );
|
||||
void clearAllResults();
|
||||
void freeAllocatedResultsData();
|
||||
void freeAllocatedResultsData( std::vector<RiaDefines::ResultCatType> categoriesToExclude, std::optional<size_t> timeStepIndexToRelease );
|
||||
void eraseAllSourSimData();
|
||||
void setRemovedTagOnGeneratedResult( const RigEclipseResultAddress& resultAddress );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user