mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8034 Pass reader settings to eclipse loading methods.
This commit is contained in:
parent
51808d5ba7
commit
f407acd5fa
@ -29,6 +29,7 @@
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RifSummaryCaseRestartSelector.h"
|
||||
|
||||
#include "RigGridManager.h"
|
||||
@ -69,10 +70,11 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog )
|
||||
bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
@ -88,7 +90,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
// Import eclipse case files
|
||||
for ( const QString& gridCaseFile : selector.gridCaseFiles() )
|
||||
{
|
||||
int caseId = RiaImportEclipseCaseTools::openEclipseCaseFromFile( gridCaseFile, createView );
|
||||
int caseId = RiaImportEclipseCaseTools::openEclipseCaseFromFile( gridCaseFile, createView, readerSettings );
|
||||
if ( caseId >= 0 )
|
||||
{
|
||||
openedFiles.insert( std::make_pair( gridCaseFile, caseId ) );
|
||||
@ -104,7 +106,8 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
}
|
||||
|
||||
// Import summary cases
|
||||
if ( !summaryFileInfos.empty() )
|
||||
bool importSummaryCases = readerSettings && readerSettings->importSummaryData;
|
||||
if ( importSummaryCases && !summaryFileInfos.empty() )
|
||||
{
|
||||
RimSummaryCaseMainCollection* sumCaseColl =
|
||||
project->activeOilField() ? project->activeOilField()->summaryCaseMainCollection() : nullptr;
|
||||
@ -224,12 +227,17 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, bool createView )
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName,
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
if ( !caf::Utils::fileExists( fileName ) ) return -1;
|
||||
|
||||
bool showTimeStepFilter = false;
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView );
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName,
|
||||
showTimeStepFilter,
|
||||
createView,
|
||||
readerSettings );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -241,7 +249,10 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilter( const QString
|
||||
|
||||
bool showTimeStepFilter = true;
|
||||
bool createView = true;
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView ) >= 0;
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName,
|
||||
showTimeStepFilter,
|
||||
createView,
|
||||
nullptr ) >= 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -301,7 +312,7 @@ bool RiaImportEclipseCaseTools::openMockModel( const QString& name )
|
||||
{
|
||||
bool showTimeStepFilter = false;
|
||||
bool createView = true;
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, showTimeStepFilter, createView );
|
||||
return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, showTimeStepFilter, createView, nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -309,13 +320,15 @@ bool RiaImportEclipseCaseTools::openMockModel( const QString& name )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
bool createView )
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
QFileInfo gridFileName( fileName );
|
||||
QString caseName = gridFileName.completeBaseName();
|
||||
|
||||
RimEclipseResultCase* rimResultReservoir = new RimEclipseResultCase();
|
||||
rimResultReservoir->setCaseInfo( caseName, fileName );
|
||||
rimResultReservoir->setReaderSettings( readerSettings );
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
|
@ -19,11 +19,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RifReaderSettings;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -33,10 +35,11 @@ class RiaImportEclipseCaseTools
|
||||
public:
|
||||
typedef std::map<QString, int> FileCaseIdMap;
|
||||
|
||||
static bool openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog );
|
||||
static bool openEclipseCasesFromFile( const QStringList& fileNames,
|
||||
bool createView,
|
||||
FileCaseIdMap* openedFilesOut,
|
||||
bool noDialog,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
|
||||
static bool openEclipseCaseShowTimeStepFilter( const QString& fileName );
|
||||
|
||||
@ -45,8 +48,13 @@ public:
|
||||
|
||||
static bool addEclipseCases( const QStringList& fileNames, RimIdenticalGridCaseGroup** resultingCaseGroup = nullptr );
|
||||
|
||||
static int openEclipseCaseFromFile( const QString& fileName, bool createView );
|
||||
static int openEclipseCaseFromFile( const QString& fileName,
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
|
||||
private:
|
||||
static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName, bool showTimeStepFilter, bool createView );
|
||||
static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName,
|
||||
bool showTimeStepFilter,
|
||||
bool createView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
};
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
|
||||
#include <QDir>
|
||||
@ -48,6 +49,7 @@ CAF_PDM_SOURCE_INIT( RicfLoadCase, "loadCase" );
|
||||
RicfLoadCase::RicfLoadCase()
|
||||
{
|
||||
CAF_PDM_InitScriptableField( &m_path, "path", QString(), "Path to Case File", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_gridOnly, "gridOnly", false, "Load Grid Data Only", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -66,10 +68,15 @@ caf::PdmScriptResponse RicfLoadCase::execute()
|
||||
RiaImportEclipseCaseTools::FileCaseIdMap fileCaseIdMap;
|
||||
bool createView = false;
|
||||
bool doNotShowDialog = true;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> readerSettings;
|
||||
if ( m_gridOnly ) readerSettings = RifReaderSettings::createGridOnlyReaderSettings();
|
||||
|
||||
bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile( QStringList( { absolutePath } ),
|
||||
createView,
|
||||
&fileCaseIdMap,
|
||||
doNotShowDialog );
|
||||
doNotShowDialog,
|
||||
readerSettings );
|
||||
if ( !ok )
|
||||
{
|
||||
QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath );
|
||||
|
@ -50,4 +50,5 @@ public:
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_path;
|
||||
caf::PdmField<bool> m_gridOnly;
|
||||
};
|
||||
|
@ -59,9 +59,10 @@ void RicImportEclipseCaseFeature::onActionTriggered( bool isChecked )
|
||||
defaultDir = QFileInfo( fileNames.last() ).absolutePath();
|
||||
app->setLastUsedDialogDirectory( "BINARY_GRID", defaultDir );
|
||||
|
||||
bool createDefaultView = false;
|
||||
std::vector<int> caseIds;
|
||||
openEclipseCaseFromFileNames( fileNames, createDefaultView, caseIds );
|
||||
bool createDefaultView = false;
|
||||
std::vector<int> caseIds;
|
||||
std::shared_ptr<RifReaderSettings> readerSettings;
|
||||
openEclipseCaseFromFileNames( fileNames, createDefaultView, caseIds, readerSettings );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "RicImportEnsembleWellLogsFeature.h"
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
#include "RicRecursiveFileSearchDialog.h"
|
||||
#include "RifReaderSettings.h"
|
||||
#include "WellPathCommands/RicImportWellPaths.h"
|
||||
|
||||
#include "RimDialogData.h"
|
||||
@ -287,9 +288,12 @@ RimEclipseCase* RicCreateEnsembleWellLogFeature::loadEclipseCase( const QString&
|
||||
}
|
||||
bool createView = false;
|
||||
bool createPlot = false;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = RifReaderSettings::createGridOnlyReaderSettings();
|
||||
auto openResult = RicImportGeneralDataFeature::openEclipseFilesFromFileNames( QStringList( { absolutePath } ),
|
||||
createPlot,
|
||||
createView );
|
||||
createView,
|
||||
readerSettings );
|
||||
|
||||
if ( !openResult.createdCaseIds.empty() )
|
||||
{
|
||||
|
@ -43,9 +43,10 @@ CAF_CMD_SOURCE_INIT( RicImportGeneralDataFeature, "RicImportGeneralDataFeature"
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicImportGeneralDataFeature::OpenCaseResults
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView )
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
CVF_ASSERT( !fileNames.empty() );
|
||||
|
||||
@ -75,7 +76,7 @@ RicImportGeneralDataFeature::OpenCaseResults
|
||||
OpenCaseResults results;
|
||||
if ( !eclipseCaseFiles.empty() )
|
||||
{
|
||||
if ( !openEclipseCaseFromFileNames( eclipseCaseFiles, createDefaultView, results.createdCaseIds ) )
|
||||
if ( !openEclipseCaseFromFileNames( eclipseCaseFiles, createDefaultView, results.createdCaseIds, readerSettings ) )
|
||||
{
|
||||
return OpenCaseResults();
|
||||
}
|
||||
@ -221,7 +222,7 @@ void RicImportGeneralDataFeature::openFileDialog( ImportFileType fileTypes )
|
||||
fileNames.front() );
|
||||
}
|
||||
|
||||
if ( !openEclipseFilesFromFileNames( fileNames, true, true ) )
|
||||
if ( !openEclipseFilesFromFileNames( fileNames, true, true, nullptr ) )
|
||||
{
|
||||
RiaLogging::error( QString( "Failed to open file names: %1" ).arg( fileNames.join( ", " ) ) );
|
||||
}
|
||||
@ -230,13 +231,14 @@ void RicImportGeneralDataFeature::openFileDialog( ImportFileType fileTypes )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicImportGeneralDataFeature::openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds )
|
||||
bool RicImportGeneralDataFeature::openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
bool noDialog = false;
|
||||
RiaImportEclipseCaseTools::FileCaseIdMap newCaseFiles;
|
||||
if ( RiaImportEclipseCaseTools::openEclipseCasesFromFile( fileNames, createDefaultView, &newCaseFiles, noDialog ) )
|
||||
if ( RiaImportEclipseCaseTools::openEclipseCasesFromFile( fileNames, createDefaultView, &newCaseFiles, noDialog, readerSettings ) )
|
||||
{
|
||||
for ( const auto& newCaseFileAndId : newCaseFiles )
|
||||
{
|
||||
|
@ -24,8 +24,11 @@
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class RifReaderSettings;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@ -48,10 +51,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static OpenCaseResults
|
||||
openEclipseFilesFromFileNames( const QStringList& fileNames, bool doCreateDefaultPlot, bool createDefaultView );
|
||||
static QStringList fileNamesFromCaseNames( const QStringList& caseNames );
|
||||
static QStringList getEclipseFileNamesWithDialog( RiaDefines::ImportFileType fileTypes );
|
||||
static OpenCaseResults openEclipseFilesFromFileNames( const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
bool createDefaultView,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
||||
static QStringList fileNamesFromCaseNames( const QStringList& caseNames );
|
||||
static QStringList getEclipseFileNamesWithDialog( RiaDefines::ImportFileType fileTypes );
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
@ -61,9 +66,10 @@ protected:
|
||||
|
||||
static void openFileDialog( RiaDefines::ImportFileType fileTypes );
|
||||
|
||||
static bool openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds );
|
||||
static bool openEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds,
|
||||
std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
static bool openInputEclipseCaseFromFileNames( const QStringList& fileNames,
|
||||
bool createDefaultView,
|
||||
std::vector<int>& createdCaseIds );
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "RiaCellDividingTools.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RiaStringEncodingTools.h"
|
||||
#include "RifActiveCellsReader.h"
|
||||
@ -490,15 +489,14 @@ bool RifReaderEclipseOutput::open( const QString& fileName, RigEclipseCaseData*
|
||||
RigActiveCellInfo* activeCellInfo =
|
||||
m_eclipseCase->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
bool includeInactiveCells = RiaPreferences::current()->readerSettings()->includeInactiveCellsInFaultGeometry;
|
||||
|
||||
bool includeInactiveCells = includeInactiveCellsInFaultGeometry();
|
||||
mainGrid->nncData()->setSourceDataForProcessing( mainGrid, activeCellInfo, includeInactiveCells );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto task = progress.task( "Handling well information", 10 );
|
||||
if ( !RiaPreferences::current()->readerSettings()->skipWellData() )
|
||||
if ( !isSkipWellData() )
|
||||
{
|
||||
readWellCells( mainEclGrid, isImportOfCompleteMswDataEnabled() );
|
||||
}
|
||||
|
@ -47,6 +47,14 @@ bool RifReaderInterface::isNNCsEnabled()
|
||||
return readerSettings()->importNNCs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isSkipWellData()
|
||||
{
|
||||
return readerSettings()->skipWellData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -115,9 +123,24 @@ size_t RifReaderInterface::timeStepIndexOnFile( size_t timeStepIndex ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RifReaderSettings* RifReaderInterface::readerSettings() const
|
||||
{
|
||||
RiaPreferences* prefs = RiaPreferences::current();
|
||||
if ( m_readerSettings )
|
||||
{
|
||||
return m_readerSettings.get();
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaPreferences* prefs = RiaPreferences::current();
|
||||
|
||||
CVF_ASSERT( prefs->readerSettings() );
|
||||
CVF_ASSERT( prefs->readerSettings() );
|
||||
|
||||
return prefs->readerSettings();
|
||||
return prefs->readerSettings();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderInterface::setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
m_readerSettings = readerSettings;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
@ -47,10 +48,13 @@ public:
|
||||
RifReaderInterface() {}
|
||||
~RifReaderInterface() override {}
|
||||
|
||||
void setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
|
||||
bool isFaultImportEnabled();
|
||||
bool isImportOfCompleteMswDataEnabled();
|
||||
bool isNNCsEnabled();
|
||||
bool includeInactiveCellsInFaultGeometry();
|
||||
bool isSkipWellData();
|
||||
const QString faultIncludeFileAbsolutePathPrefix();
|
||||
|
||||
virtual bool open( const QString& fileName, RigEclipseCaseData* eclipseCase ) = 0;
|
||||
@ -83,4 +87,6 @@ private:
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
|
||||
std::vector<size_t> m_fileTimeStepIndices;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> m_readerSettings;
|
||||
};
|
||||
|
@ -72,6 +72,9 @@ RifReaderSettings::RifReaderSettings()
|
||||
"Path used to prefix absolute UNIX paths in include statements on Windows, used when searching "
|
||||
"for FAULTS and EQUIL",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitField( &importSummaryData, "importSummaryData", true, "Import summary data", "", "", "" );
|
||||
importSummaryData.uiCapability()->setUiHidden( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -95,3 +98,19 @@ void RifReaderSettings::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
|
||||
includeFileAbsolutePathPrefix.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
importNNCs.uiCapability()->setUiReadOnly( setFaultImportSettingsReadOnly );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::shared_ptr<RifReaderSettings> RifReaderSettings::createGridOnlyReaderSettings()
|
||||
{
|
||||
std::shared_ptr<RifReaderSettings> readerSettings = std::make_shared<RifReaderSettings>();
|
||||
// Disable as much as possible
|
||||
readerSettings->importNNCs = false;
|
||||
readerSettings->importFaults = false;
|
||||
readerSettings->skipWellData = true;
|
||||
readerSettings->includeInactiveCellsInFaultGeometry = false;
|
||||
readerSettings->importAdvancedMswData = false;
|
||||
readerSettings->importSummaryData = false;
|
||||
return readerSettings;
|
||||
}
|
||||
|
@ -42,6 +42,9 @@ public:
|
||||
caf::PdmField<QString> includeFileAbsolutePathPrefix;
|
||||
caf::PdmField<bool> useResultIndexFile;
|
||||
caf::PdmField<bool> skipWellData;
|
||||
caf::PdmField<bool> importSummaryData;
|
||||
|
||||
static std::shared_ptr<RifReaderSettings> createGridOnlyReaderSettings();
|
||||
|
||||
private:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
@ -696,7 +696,8 @@ void RimEclipseCase::ensureFaultDataIsComputed()
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if ( rigEclipseCase )
|
||||
{
|
||||
bool computeFaults = RiaPreferences::current()->readerSettings()->importFaults();
|
||||
bool computeFaults = ( m_readerSettings && m_readerSettings->importFaults() ) ||
|
||||
( !m_readerSettings && RiaPreferences::current()->readerSettings()->importFaults() );
|
||||
if ( computeFaults )
|
||||
{
|
||||
RigActiveCellInfo* actCellInfo = rigEclipseCase->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
@ -1116,3 +1117,11 @@ bool RimEclipseCase::importAsciiInputProperties( const QStringList& fileNames )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings )
|
||||
{
|
||||
m_readerSettings = readerSettings;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
class QString;
|
||||
@ -49,6 +50,7 @@ class RimEclipseInputPropertyCollection;
|
||||
class RimEclipseView;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimReservoirCellResultsStorage;
|
||||
class RifReaderSettings;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@ -119,6 +121,8 @@ public:
|
||||
bool ensureNncDataIsComputed();
|
||||
void createDisplayModelAndUpdateAllViews();
|
||||
|
||||
void setReaderSettings( std::shared_ptr<RifReaderSettings> readerSettings );
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
@ -141,6 +145,8 @@ protected:
|
||||
caf::PdmField<bool> m_flipYAxis;
|
||||
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
|
||||
|
||||
std::shared_ptr<RifReaderSettings> m_readerSettings;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_releaseResultMemory;
|
||||
|
||||
|
@ -134,6 +134,7 @@ bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter
|
||||
|
||||
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
|
||||
readerEclipseOutput->setFilenamesWithFaults( this->filesContainingFaults() );
|
||||
readerEclipseOutput->setReaderSettings( m_readerSettings );
|
||||
|
||||
cvf::ref<RifEclipseRestartDataAccess> restartDataAccess =
|
||||
RifEclipseOutputFileTools::createDynamicResultAccess( gridFileName() );
|
||||
|
@ -21,6 +21,7 @@ service Commands
|
||||
message FilePathRequest
|
||||
{
|
||||
string path = 1;
|
||||
bool gridOnly = 2;
|
||||
}
|
||||
|
||||
message ReplaceCaseRequest
|
||||
|
@ -41,7 +41,8 @@ for realization in range(0, num_realizations):
|
||||
for path in case_file_paths:
|
||||
# Load a case
|
||||
path_name = path.as_posix()
|
||||
case = resinsight.project.load_case(path_name)
|
||||
grid_only = True
|
||||
case = resinsight.project.load_case(path_name, grid_only)
|
||||
|
||||
# Load some wells
|
||||
well_paths = resinsight.project.import_well_paths(
|
||||
|
@ -62,7 +62,7 @@ def close(self):
|
||||
|
||||
|
||||
@add_method(Project)
|
||||
def load_case(self, path):
|
||||
def load_case(self, path, grid_only=False):
|
||||
"""Load a new grid case from the given file path
|
||||
|
||||
Arguments:
|
||||
@ -71,7 +71,7 @@ def load_case(self, path):
|
||||
:class:`rips.generated.generated_classes.Case`
|
||||
"""
|
||||
command_reply = self._execute_command(
|
||||
loadCase=Commands_pb2.FilePathRequest(path=path)
|
||||
loadCase=Commands_pb2.FilePathRequest(path=path, gridOnly=grid_only)
|
||||
)
|
||||
return self.case(command_reply.loadCaseResult.id)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user