mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
NNC: Compute data on demand
This commit is contained in:
@@ -707,6 +707,38 @@ void RimEclipseCase::ensureFaultDataIsComputed()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseCase::ensureNncDataIsComputed()
|
||||
{
|
||||
bool computedData = false;
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if ( rigEclipseCase && rigEclipseCase->mainGrid() )
|
||||
{
|
||||
computedData = rigEclipseCase->mainGrid()->nncData()->ensureConnectionDataIsProcecced();
|
||||
}
|
||||
|
||||
return computedData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::createDisplayModelAndUpdateAllViews()
|
||||
{
|
||||
for ( const auto& v : views() )
|
||||
{
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( v );
|
||||
if ( eclipseView )
|
||||
{
|
||||
eclipseView->scheduleReservoirGridGeometryRegen();
|
||||
}
|
||||
|
||||
v->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -116,6 +116,8 @@ public:
|
||||
void loadAndSyncronizeInputProperties( bool includeGridFileName );
|
||||
|
||||
void ensureFaultDataIsComputed();
|
||||
bool ensureNncDataIsComputed();
|
||||
void createDisplayModelAndUpdateAllViews();
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaNncDefines.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
@@ -1150,6 +1151,19 @@ void RimEclipseResultDefinition::loadResult()
|
||||
gridCellResults->createResultEntry( this->eclipseResultAddress(), false );
|
||||
}
|
||||
|
||||
QString resultName = m_resultVariable();
|
||||
std::set<QString> eclipseResultNamesWithNncData = RiaDefines::nncResultNames();
|
||||
if ( eclipseResultNamesWithNncData.find( resultName ) != eclipseResultNamesWithNncData.end() )
|
||||
{
|
||||
eclipseCase()->ensureFaultDataIsComputed();
|
||||
|
||||
bool dataWasComputed = eclipseCase()->ensureNncDataIsComputed();
|
||||
if ( dataWasComputed )
|
||||
{
|
||||
eclipseCase()->createDisplayModelAndUpdateAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
gridCellResults->ensureKnownResultLoaded( this->eclipseResultAddress() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user