mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
Performance: Control how much data to import from file
User can control if faults, NNCs and simulation wells are to be imported from file.
This commit is contained in:
parent
d8f412017e
commit
032a263685
@ -22,6 +22,7 @@
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RiaPreferences, "RiaPreferences");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -61,10 +62,16 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", "");
|
||||
lastUsedProjectFileName.setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&autocomputeSOIL, "autocomputeSOIL", true, "SOIL", "", "SOIL = 1.0 - SGAS - SWAT", "");
|
||||
CAF_PDM_InitField(&autocomputeDepthRelatedProperties,"autocomputeDepth", true, "DEPTH related properties", "", "DEPTH, DX, DY, DZ, TOP, BOTTOM", "");
|
||||
CAF_PDM_InitField(&autocomputeSOIL, "autocomputeSOIL", true, "SOIL", "", "SOIL = 1.0 - SGAS - SWAT", "");
|
||||
CAF_PDM_InitField(&autocomputeDepthRelatedProperties, "autocomputeDepth", true, "DEPTH related properties", "", "DEPTH, DX, DY, DZ, TOP, BOTTOM", "");
|
||||
CAF_PDM_InitField(&autocomputeGridFaults, "autocomputeGridFaults", true, "Grid faults", "", "Detect all fault faces geometrically", "");
|
||||
|
||||
CAF_PDM_InitField(&readFaultData, "readFaultData", true, "Read fault data", "", "", "");
|
||||
autocomputeDepthRelatedProperties.setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
autocomputeSOIL.setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
autocomputeGridFaults.setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
readerSettings = new RifReaderSettings;
|
||||
CAF_PDM_InitFieldNoDefault(&readerSettings, "readerSettings", "Reader settings", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -80,6 +87,8 @@ RiaPreferences::~RiaPreferences(void)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute)
|
||||
{
|
||||
readerSettings->defineEditorAttribute(field, uiConfigName, attribute);
|
||||
|
||||
if (field == &scriptDirectories)
|
||||
{
|
||||
caf::PdmUiFilePathEditorAttribute* myAttr = static_cast<caf::PdmUiFilePathEditorAttribute*>(attribute);
|
||||
@ -89,7 +98,10 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
|
||||
myAttr->m_appendUiSelectedFolderToText = true;
|
||||
}
|
||||
}
|
||||
else if (field == &octaveShowHeaderInfoWhenExecutingScripts)
|
||||
else if (field == &octaveShowHeaderInfoWhenExecutingScripts ||
|
||||
field == &autocomputeSOIL ||
|
||||
field == &autocomputeDepthRelatedProperties ||
|
||||
field == &autocomputeGridFaults)
|
||||
{
|
||||
caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast<caf::PdmUiCheckBoxEditorAttribute*>(attribute);
|
||||
if (myAttr)
|
||||
@ -125,9 +137,16 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* autoComputeGroup = uiOrdering.addNewGroup("Compute when loading new case");
|
||||
autoComputeGroup->add(&autocomputeSOIL);
|
||||
autoComputeGroup->add(&autocomputeDepthRelatedProperties);
|
||||
autoComputeGroup->add(&autocomputeGridFaults);
|
||||
|
||||
caf::PdmUiGroup* faultsGroup = uiOrdering.addNewGroup("Faults");
|
||||
faultsGroup->add(&readFaultData);
|
||||
|
||||
caf::PdmUiGroup* readerSettingsGroup = uiOrdering.addNewGroup("Reader settings");
|
||||
std::vector<caf::PdmFieldHandle*> readerSettingsFields;
|
||||
readerSettings->fields(readerSettingsFields);
|
||||
for (size_t i = 0; i < readerSettingsFields.size(); i++)
|
||||
{
|
||||
readerSettingsGroup->add(readerSettingsFields[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -142,6 +161,7 @@ void RiaPreferences::configureForRegressionTests()
|
||||
autocomputeSOIL = true;
|
||||
autocomputeDepthRelatedProperties = true;
|
||||
|
||||
readFaultData = false;
|
||||
CVF_ASSERT(readerSettings);
|
||||
readerSettings->importFaults = false;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
// Include to make Pdm work for cvf::Color
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
class RifReaderSettings;
|
||||
|
||||
class RiaPreferences : public caf::PdmObject
|
||||
{
|
||||
@ -63,8 +64,9 @@ public: // Pdm Fields
|
||||
|
||||
caf::PdmField<bool> autocomputeSOIL;
|
||||
caf::PdmField<bool> autocomputeDepthRelatedProperties;
|
||||
caf::PdmField<bool> autocomputeGridFaults;
|
||||
|
||||
caf::PdmField<bool> readFaultData;
|
||||
caf::PdmField<RifReaderSettings*> readerSettings;
|
||||
|
||||
protected:
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
|
@ -15,6 +15,7 @@ ${CEE_CURRENT_LIST_DIR}RifReaderEclipseOutput.h
|
||||
${CEE_CURRENT_LIST_DIR}RifJsonEncodeDecode.h
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderInterface.h
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderMockModel.h
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderSettings.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -26,7 +27,9 @@ ${CEE_CURRENT_LIST_DIR}RifEclipseUnifiedRestartFileAccess.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderEclipseInput.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderEclipseOutput.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifJsonEncodeDecode.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderInterface.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderMockModel.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RifReaderSettings.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -59,6 +59,7 @@ set( UNIT_TEST_CPP_SOURCES
|
||||
)
|
||||
|
||||
set( LINK_LIBRARIES
|
||||
cafProjectDataModel
|
||||
CommonCode
|
||||
|
||||
LibViewing
|
||||
|
@ -434,17 +434,26 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigCaseData* eclipseC
|
||||
|
||||
progInfo.setProgressDescription("Reading NNC data");
|
||||
progInfo.setNextProgressIncrement(5);
|
||||
transferNNCData(mainEclGrid, m_ecl_init_file, eclipseCase->mainGrid());
|
||||
if (isNNCsEnabled())
|
||||
{
|
||||
transferNNCData(mainEclGrid, m_ecl_init_file, eclipseCase->mainGrid());
|
||||
}
|
||||
progInfo.incrementProgress();
|
||||
|
||||
progInfo.setProgressDescription("Processing NNC data");
|
||||
progInfo.setNextProgressIncrement(20);
|
||||
eclipseCase->mainGrid()->nncData()->processConnections( *(eclipseCase->mainGrid()));
|
||||
if (isNNCsEnabled())
|
||||
{
|
||||
eclipseCase->mainGrid()->nncData()->processConnections( *(eclipseCase->mainGrid()));
|
||||
}
|
||||
progInfo.incrementProgress();
|
||||
|
||||
progInfo.setNextProgressIncrement(8);
|
||||
progInfo.setProgressDescription("Reading Well information");
|
||||
readWellCells(mainEclGrid);
|
||||
if (isSimulationWellDataEnabled())
|
||||
{
|
||||
readWellCells(mainEclGrid);
|
||||
}
|
||||
|
||||
progInfo.setProgressDescription("Releasing reader memory");
|
||||
ecl_grid_free( mainEclGrid );
|
||||
|
68
ApplicationCode/FileInterface/RifReaderInterface.cpp
Normal file
68
ApplicationCode/FileInterface/RifReaderInterface.cpp
Normal file
@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderInterface::setReaderSetting(RifReaderSettings* settings)
|
||||
{
|
||||
m_settings = settings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isFaultImportEnabled()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->importFaults;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isSimulationWellDataEnabled()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->importSimulationWellData;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isNNCsEnabled()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
{
|
||||
return m_settings->importNNCs;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
@ -22,12 +22,16 @@
|
||||
#include "cvfObject.h"
|
||||
#include "cvfLibCore.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDateTime>
|
||||
|
||||
|
||||
class RigCaseData;
|
||||
class RifReaderSettings;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@ -44,11 +48,14 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
RifReaderInterface() { m_readFaultData = false; }
|
||||
virtual ~RifReaderInterface() {}
|
||||
RifReaderInterface() { }
|
||||
virtual ~RifReaderInterface() { }
|
||||
|
||||
void readFaultData(bool readFaultData) { m_readFaultData = readFaultData; }
|
||||
bool isFaultImportEnabled() { return m_readFaultData; }
|
||||
void setReaderSetting(RifReaderSettings* settings);
|
||||
|
||||
bool isFaultImportEnabled();
|
||||
bool isSimulationWellDataEnabled();
|
||||
bool isNNCsEnabled();
|
||||
|
||||
virtual bool open(const QString& fileName, RigCaseData* eclipseCase) = 0;
|
||||
virtual void close() = 0;
|
||||
@ -63,6 +70,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
bool m_readFaultData;
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
caf::PdmPointer<RifReaderSettings> m_settings;
|
||||
};
|
||||
|
59
ApplicationCode/FileInterface/RifReaderSettings.cpp
Normal file
59
ApplicationCode/FileInterface/RifReaderSettings.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RifReaderSettings, "RifReaderSettings");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderSettings::RifReaderSettings()
|
||||
{
|
||||
CAF_PDM_InitObject("RifReaderSettings", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&importFaults, "importFaults", false, "Import faults", "", "", "");
|
||||
importFaults.setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitField(&importSimulationWellData, "importSimulationWellData", false, "Import simulation wells", "", "", "");
|
||||
importSimulationWellData.setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitField(&importNNCs, "importSimulationNNCs", false, "Import NNCs", "", "", "");
|
||||
importNNCs.setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderSettings::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &importFaults ||
|
||||
field == &importSimulationWellData ||
|
||||
field == &importNNCs)
|
||||
{
|
||||
caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast<caf::PdmUiCheckBoxEditorAttribute*>(attribute);
|
||||
if (myAttr)
|
||||
{
|
||||
myAttr->m_useNativeCheckBoxLabel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
46
ApplicationCode/FileInterface/RifReaderSettings.h
Normal file
46
ApplicationCode/FileInterface/RifReaderSettings.h
Normal file
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RifReaderSettings : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
friend class RiaPreferences;
|
||||
|
||||
public:
|
||||
RifReaderSettings();
|
||||
|
||||
caf::PdmField<bool> importFaults;
|
||||
caf::PdmField<bool> importSimulationWellData;
|
||||
caf::PdmField<bool> importNNCs;
|
||||
|
||||
protected:
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
|
||||
};
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RimCase.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RimCaseCollection.h"
|
||||
@ -298,9 +300,13 @@ void RimCase::computeCachedData()
|
||||
rigEclipseCase->mainGrid()->computeCachedData();
|
||||
pInf.incrementProgress();
|
||||
|
||||
pInf.setProgressDescription("Calculating faults");
|
||||
rigEclipseCase->mainGrid()->calculateFaults();
|
||||
pInf.incrementProgress();
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
if (prefs->autocomputeGridFaults)
|
||||
{
|
||||
pInf.setProgressDescription("Calculating faults");
|
||||
rigEclipseCase->mainGrid()->calculateFaults();
|
||||
pInf.incrementProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RifReaderEclipseInput.h"
|
||||
#include "RifReaderInterface.h"
|
||||
#include "RifReaderMockModel.h"
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RimDefines.h"
|
||||
@ -96,7 +97,7 @@ void RimInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
|
||||
for (int i = 0; i < fileNames.size(); i++)
|
||||
{
|
||||
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->reservoirData(), prefs->readFaultData()))
|
||||
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->reservoirData(), prefs->readerSettings->importFaults()))
|
||||
{
|
||||
m_gridFileName = fileNames[i];
|
||||
|
||||
@ -181,7 +182,7 @@ bool RimInputCase::openEclipseGridFile()
|
||||
{
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
readerInterface = new RifReaderEclipseInput;
|
||||
readerInterface->readFaultData(prefs->readFaultData());
|
||||
readerInterface->setReaderSetting(prefs->readerSettings());
|
||||
|
||||
cvf::ref<RigCaseData> eclipseCase = new RigCaseData;
|
||||
if (!readerInterface->open(m_gridFileName, eclipseCase.p()))
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "RifEclipseOutputFileTools.h"
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
#include "RifReaderMockModel.h"
|
||||
#include "RifReaderSettings.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RimMockModelSettings.h"
|
||||
@ -90,7 +91,7 @@ bool RimResultCase::openEclipseGridFile()
|
||||
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
readerInterface = new RifReaderEclipseOutput;
|
||||
readerInterface->readFaultData(prefs->readFaultData());
|
||||
readerInterface->setReaderSetting(prefs->readerSettings());
|
||||
readerInterface->setFilenamesWithFaults(this->filesContainingFaults());
|
||||
|
||||
cvf::ref<RigCaseData> eclipseCase = new RigCaseData;
|
||||
|
Loading…
Reference in New Issue
Block a user