mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -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:
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user