Skip to content

Commit

Permalink
#12005 Well Target Candidates: Move ensemble grid under generator in …
Browse files Browse the repository at this point in the history
…Project Tree
  • Loading branch information
kriben committed Dec 20, 2024
1 parent 944d733 commit 2f76412
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -326,17 +326,14 @@ void RimWellTargetCandidatesGenerator::generateEnsembleStatistics()
m_volumeResultType(),
limits );

RimProject* project = RimProject::current();
if ( !project ) return;

RimEclipseCaseCollection* analysisModels = project->activeOilField() ? project->activeOilField()->analysisModels() : nullptr;
if ( !analysisModels ) return;
regularGridCase->setCustomCaseName( "Ensemble Grid" );

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() )
{
Expand All @@ -345,7 +342,7 @@ void RimWellTargetCandidatesGenerator::generateEnsembleStatistics()

eclipseView->loadDataAndUpdate();

analysisModels->updateConnectedEditors();
m_ensembleStatisticsCase->updateConnectedEditors();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class RimWellTargetCandidatesGenerator : public caf::PdmObject

caf::PdmField<bool> m_generateEnsembleStatistics;

caf::PdmChildField<RimEclipseCase*> m_ensembleStatisticsCase;

double m_minimumVolume;
double m_maximumVolume;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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() );
}
Expand All @@ -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] );
}
Expand Down

0 comments on commit 2f76412

Please sign in to comment.