#12005 Well Target Candidates: Move ensemble grid under generator in Project Tree

This commit is contained in:
Kristian Bendiksen 2024-12-20 11:11:36 +01:00
parent ac985ade00
commit d1aec2f1cb
3 changed files with 11 additions and 12 deletions

View File

@ -35,8 +35,6 @@
#include "RimEclipseCellColors.h"
#include "RimEclipseResultDefinition.h"
#include "RimEclipseView.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimRegularGridCase.h"
#include "RimTools.h"
@ -123,6 +121,8 @@ RimWellTargetCandidatesGenerator::RimWellTargetCandidatesGenerator()
CAF_PDM_InitField( &m_generateEnsembleStatistics, "GenerateEnsembleStatistics", true, "Generate Ensemble Statistics" );
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_generateEnsembleStatistics );
CAF_PDM_InitFieldNoDefault( &m_ensembleStatisticsCase, "EnsembleStatisticsCase", "Ensemble Statistics Case" );
m_minimumVolume = cvf::UNDEFINED_DOUBLE;
m_maximumVolume = cvf::UNDEFINED_DOUBLE;
@ -326,17 +326,14 @@ void RimWellTargetCandidatesGenerator::generateEnsembleStatistics()
m_volumeResultType(),
limits );
RimProject* project = RimProject::current();
if ( !project ) return;
regularGridCase->setCustomCaseName( "Ensemble Grid" );
RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() : nullptr;
if ( !analysisModels ) return;
analysisModels->cases.push_back( regularGridCase );
m_ensembleStatisticsCase = regularGridCase;
auto eclipseView = regularGridCase->createAndAddReservoirView();
eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::GENERATED );
eclipseView->cellResult()->setResultVariable( "TOTAL_PORV_SOIL_P10" );
if ( RiaGuiApplication::isRunning() || RiuMainWindow::instance() )
{
@ -345,7 +342,7 @@ void RimWellTargetCandidatesGenerator::generateEnsembleStatistics()
eclipseView->loadDataAndUpdate();
analysisModels->updateConnectedEditors();
m_ensembleStatisticsCase->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------

View File

@ -81,6 +81,8 @@ private:
caf::PdmField<bool> m_generateEnsembleStatistics;
caf::PdmChildField<RimEclipseCase*> m_ensembleStatisticsCase;
double m_minimumVolume;
double m_maximumVolume;

View File

@ -882,7 +882,7 @@ void RigWellTargetCandidatesGenerator::accumulateResultsForSingleCase( RimEclips
std::map<QString, const std::vector<double>*> namedInputVector;
for ( auto [resultName, vec] : resultNamesAndSamples )
for ( const auto& [resultName, vec] : resultNamesAndSamples )
{
RigEclipseResultAddress resultAddress( RiaDefines::ResultCatType::GENERATED, resultName );
resultsData->ensureKnownResultLoaded( resultAddress );
@ -891,7 +891,7 @@ void RigWellTargetCandidatesGenerator::accumulateResultsForSingleCase( RimEclips
}
std::map<QString, std::vector<double>> namedOutputVector;
for ( auto [resultName, vec] : resultNamesAndSamples )
for ( const auto& [resultName, vec] : resultNamesAndSamples )
{
namedOutputVector[resultName] = std::vector( targetNumActiveCells, std::numeric_limits<double>::infinity() );
}
@ -918,7 +918,7 @@ void RigWellTargetCandidatesGenerator::accumulateResultsForSingleCase( RimEclips
}
}
for ( auto [resultName, vec] : resultNamesAndSamples )
for ( const auto& [resultName, vec] : resultNamesAndSamples )
{
resultNamesAndSamples[resultName].push_back( namedOutputVector[resultName] );
}